diff --git a/UMLModel/src/org/uml/model/relations/CardinalityEnum.java b/UMLModel/src/org/uml/model/relations/CardinalityEnum.java index 9502fbb..d1c311e 100644 --- a/UMLModel/src/org/uml/model/relations/CardinalityEnum.java +++ b/UMLModel/src/org/uml/model/relations/CardinalityEnum.java @@ -18,7 +18,7 @@ public enum CardinalityEnum { One2One { @Override public String toString() { - return "1..1"; + return "1"; } }, /** @@ -45,7 +45,7 @@ public String toString() { Zero2Many { @Override public String toString() { - return "0..*"; + return "*"; } }; @@ -57,7 +57,7 @@ public String toString() { * @return */ public static CardinalityEnum parseString(String cardinalityEnum) { - if (cardinalityEnum.equalsIgnoreCase("1..1")) { + if (cardinalityEnum.equalsIgnoreCase("1")) { return CardinalityEnum.One2One; } if (cardinalityEnum.equalsIgnoreCase("0..1")) { @@ -66,7 +66,7 @@ public static CardinalityEnum parseString(String cardinalityEnum) { if (cardinalityEnum.equalsIgnoreCase("1..*")) { return CardinalityEnum.One2Many; } - if (cardinalityEnum.equalsIgnoreCase("0..*")) { + if (cardinalityEnum.equalsIgnoreCase("*")) { return CardinalityEnum.Zero2Many; } return CardinalityEnum.Zero2One; diff --git a/UMLVisual/src/org/uml/visual/themes/BlueGrayTheme.java b/UMLVisual/src/org/uml/visual/themes/BlueGrayTheme.java index db7b9e3..387888c 100644 --- a/UMLVisual/src/org/uml/visual/themes/BlueGrayTheme.java +++ b/UMLVisual/src/org/uml/visual/themes/BlueGrayTheme.java @@ -1,6 +1,7 @@ package org.uml.visual.themes; import java.awt.Color; +import java.awt.Paint; import org.netbeans.api.visual.border.Border; import org.netbeans.api.visual.border.BorderFactory; import static org.uml.visual.widgets.components.ComponentWidgetBase.SELECT_BORDER_SIZE; @@ -45,6 +46,8 @@ public class BlueGrayTheme implements Theme { protected static final Color DEFAULT_FONT_COLOR = Color.BLACK; protected static final Color HOVER_FONT_COLOR = DEFAULT_FONT_COLOR; protected static final Color SELECT_FONT_COLOR = Color.WHITE; + + protected static final Color SCENE_BACKGROUND_COLOR = Color.WHITE; @Override public String getName() { @@ -165,4 +168,9 @@ public Color getHoverFontColor() { public Color getSelectFontColor() { return SELECT_FONT_COLOR; } + + @Override + public Paint getSceneBackgroundColor() { + return SCENE_BACKGROUND_COLOR; + } } diff --git a/UMLVisual/src/org/uml/visual/themes/SandRedTheme.java b/UMLVisual/src/org/uml/visual/themes/SandRedTheme.java index 5a6abd6..458108e 100644 --- a/UMLVisual/src/org/uml/visual/themes/SandRedTheme.java +++ b/UMLVisual/src/org/uml/visual/themes/SandRedTheme.java @@ -1,6 +1,7 @@ package org.uml.visual.themes; import java.awt.Color; +import java.awt.Paint; import org.netbeans.api.visual.border.Border; import org.netbeans.api.visual.border.BorderFactory; import static org.uml.visual.widgets.components.ComponentWidgetBase.SELECT_BORDER_SIZE; @@ -46,6 +47,8 @@ public class SandRedTheme implements Theme { protected static final Color DEFAULT_FONT_COLOR = Color.BLACK; protected static final Color HOVER_FONT_COLOR = DEFAULT_FONT_COLOR; protected static final Color SELECT_FONT_COLOR = Color.WHITE; + + protected static final Color SCENE_BACKGROUND_COLOR = Color.WHITE; @Override public String getName() { @@ -166,4 +169,9 @@ public Color getHoverFontColor() { public Color getSelectFontColor() { return SELECT_FONT_COLOR; } + + @Override + public Paint getSceneBackgroundColor() { + return SCENE_BACKGROUND_COLOR; + } } diff --git a/UMLVisual/src/org/uml/visual/themes/Theme.java b/UMLVisual/src/org/uml/visual/themes/Theme.java index a319488..dc91589 100644 --- a/UMLVisual/src/org/uml/visual/themes/Theme.java +++ b/UMLVisual/src/org/uml/visual/themes/Theme.java @@ -1,6 +1,7 @@ package org.uml.visual.themes; import java.awt.Color; +import java.awt.Paint; import org.netbeans.api.visual.border.Border; /** @@ -42,4 +43,6 @@ public interface Theme { public Color getSelectFontColor(); public String getName(); + + public Paint getSceneBackgroundColor(); } diff --git a/UMLVisual/src/org/uml/visual/widgets/ClassDiagramScene.java b/UMLVisual/src/org/uml/visual/widgets/ClassDiagramScene.java index cf21587..22c7439 100644 --- a/UMLVisual/src/org/uml/visual/widgets/ClassDiagramScene.java +++ b/UMLVisual/src/org/uml/visual/widgets/ClassDiagramScene.java @@ -134,7 +134,9 @@ public ClassDiagramScene(ClassDiagram umlClassDiagram, final UMLTopComponent uml addChild(connectionLayer); interractionLayer = new LayerWidget(this); addChild(interractionLayer); - + + setBackground(colorTheme.getSceneBackgroundColor()); + // middle-click + drag Scene.getInputBindings().getPanActionButton() getActions().addAction(ActionFactory.createPanAction()); // ctrl + scroll Scene.getInputBindings().getZoomActionModifiers() @@ -201,6 +203,7 @@ public Theme getColorTheme() { public void setColorTheme(String name) { colorTheme = ColorThemesStore.getColorTheme(name); + setBackground(colorTheme.getSceneBackgroundColor()); for (Widget widget : mainLayer.getChildren()) { if (widget instanceof ComponentWidgetBase) { ComponentWidgetBase componentWidget = (ComponentWidgetBase) widget; diff --git a/UMLVisual/src/org/uml/visual/widgets/components/ComponentWidgetBase.java b/UMLVisual/src/org/uml/visual/widgets/components/ComponentWidgetBase.java index 4ad295f..22da0a6 100644 --- a/UMLVisual/src/org/uml/visual/widgets/components/ComponentWidgetBase.java +++ b/UMLVisual/src/org/uml/visual/widgets/components/ComponentWidgetBase.java @@ -81,7 +81,7 @@ public ComponentWidgetBase(final ClassDiagramScene scene, ComponentBase componen setLayout(LayoutFactory.createVerticalFlowLayout()); setOpaque(true); setCheckClipping(true); - setBackground(getColorTheme().getDefaultColor()); +// setBackground(getColorTheme().getDefaultColor()); //ovo je visak headerWidget = new Widget(scene); // mora ovako zbog layouta ne moze this headerWidget.setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.CENTER, 0));