svn commit: r17230 - branches/BRANCH_0_28_x: . src src/argouml-app src/argouml-app/src/org/argouml/ui src/argouml-app/tests/org/argouml/profile src/argouml-core-diagrams-sequence2 www/psf
Linus Tolke <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: linus
Date: 2009-08-08 09:32:32-0700
New Revision: 17230
Modified:
branches/BRANCH_0_28_x/ (props changed)
branches/BRANCH_0_28_x/src/ (props changed)
branches/BRANCH_0_28_x/src/argouml-app/ (props changed)
branches/BRANCH_0_28_x/src/argouml-app/src/org/argouml/ui/StylePanelFig.java
branches/BRANCH_0_28_x/src/argouml-app/tests/org/argouml/profile/ (props changed)
branches/BRANCH_0_28_x/src/argouml-core-diagrams-sequence2/ (props changed)
branches/BRANCH_0_28_x/www/psf/argouml-xml-umlpropertypanels.psf (props changed)
Log:
Merged issue 5837 (17101 from trunk).
Modified: branches/BRANCH_0_28_x/src/argouml-app/src/org/argouml/ui/StylePanelFig.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_28_x/src/argouml-app/src/org/argouml/ui/StylePanelFig.java?view=diff&pathrev=17230&r1=17229&r2=17230
==============================================================================
--- branches/BRANCH_0_28_x/src/argouml-app/src/org/argouml/ui/StylePanelFig.java (original)
+++ branches/BRANCH_0_28_x/src/argouml-app/src/org/argouml/ui/StylePanelFig.java 2009-08-08 09:32:32-0700
@@ -43,9 +43,13 @@
import org.apache.log4j.Logger;
import org.argouml.i18n.Translator;
import org.argouml.swingext.SpacerPanel;
+import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramUtils;
import org.argouml.uml.diagram.DiagramSettings.StereotypeStyle;
import org.argouml.uml.diagram.ui.ArgoFig;
import org.argouml.uml.diagram.ui.FigEdgeModelElement;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
import org.argouml.uml.diagram.ui.StereotypeStyled;
import org.argouml.util.ArgoFrame;
import org.tigris.gef.presentation.Fig;
@@ -460,11 +464,32 @@
if (target == null || c == null) {
return;
}
- if (c instanceof Color) {
+ Boolean isColor = (c instanceof Color);
+ if (isColor) {
target.setFillColor((Color) c);
}
- target.setFilled(c instanceof Color);
+ target.setFilled(isColor);
target.endTrans();
+
+ // TODO: The following handling of multiselection is just a local
+ // solution for the fill color, better find a more general solution:
+ // (I don't know if it's undoable this way - thn)
+ ArgoDiagram activeDiagram = DiagramUtils.getActiveDiagram();
+ for (Object t : TargetManager.getInstance().getTargets()) {
+ Fig fig = null;
+ if (t instanceof FigNodeModelElement) {
+ fig = (Fig) t;
+ } else {
+ fig = activeDiagram.presentationFor(t);
+ }
+ if (fig != null && fig != target) {
+ if (isColor) {
+ fig.setFillColor((Color) c);
+ }
+ fig.setFilled(isColor);
+ fig.endTrans();
+ }
+ }
}
/**
@@ -476,11 +501,32 @@
if (target == null || c == null) {
return;
}
- if (c instanceof Color) {
+ Boolean isColor = (c instanceof Color);
+ if (isColor) {
target.setLineColor((Color) c);
}
- target.setLineWidth((c instanceof Color) ? ArgoFig.LINE_WIDTH : 0);
+ target.setLineWidth(isColor ? ArgoFig.LINE_WIDTH : 0);
target.endTrans();
+
+ // TODO: The following handling of multiselection is just a local
+ // solution for the line color, better find a more general solution:
+ // (I don't know if it's undoable this way - thn)
+ ArgoDiagram activeDiagram = DiagramUtils.getActiveDiagram();
+ for (Object t : TargetManager.getInstance().getTargets()) {
+ Fig fig = null;
+ if (t instanceof FigNodeModelElement) {
+ fig = (Fig) t;
+ } else {
+ fig = activeDiagram.presentationFor(t);
+ }
+ if (fig != null && fig != target) {
+ if (isColor) {
+ fig.setLineColor((Color) c);
+ }
+ fig.setLineWidth(isColor ? ArgoFig.LINE_WIDTH : 0);
+ fig.endTrans();
+ }
+ }
}
/*
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2381636
To unsubscribe from this discussion, e-mail: [[email protected]].