Author: bobtarling Date: 2011-05-25 11:06:21-0700 New Revision: 19512 Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigActor.java
Log: Repaint shadow of an actor Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&pathrev=19512&r1=19511&r2=19512 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java (original) +++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java 2011-05-25 11:06:21-0700 @@ -346,6 +346,7 @@ private void constructFigs() { // TODO: Why isn't this stuff managed by the nameFig itself? nameFig.setFilled(true); + nameFig.setText(placeString()); nameFig.setBotMargin(7); // make space for the clarifier nameFig.setRightMargin(4); // margin between text and border nameFig.setLeftMargin(4); @@ -416,6 +417,8 @@ + element.getClass().getName()); } + nameFig.setText(placeString()); + if (element != null) { NotationName nn = Notation.findNotation(notationSettings.getNotationLanguage()); notationProviderName = @@ -754,16 +757,16 @@ if ((items & ABSTRACT) > 0) { modifierMenu.addCheckItem(new ActionModifierAbstract(getOwner())); - } + } if ((items & LEAF) > 0) { modifierMenu.addCheckItem(new ActionModifierLeaf(getOwner())); - } + } if ((items & ROOT) > 0) { modifierMenu.addCheckItem(new ActionModifierRoot(getOwner())); - } + } if ((items & ACTIVE) > 0) { modifierMenu.addCheckItem(new ActionModifierActive(getOwner())); - } + } return modifierMenu; } @@ -790,23 +793,23 @@ public void setEnclosingFig(Fig newEncloser) { Fig oldEncloser = encloser; - LayerPerspective layer = (LayerPerspective) getLayer(); - if (layer != null) { + LayerPerspective layer = (LayerPerspective) getLayer(); + if (layer != null) { ArgoDiagram diagram = (ArgoDiagram) layer.getDiagram(); diagram.encloserChanged( this, - (FigNode) oldEncloser, - (FigNode) newEncloser); - } - - super.setEnclosingFig(newEncloser); - - if (layer != null && newEncloser != oldEncloser) { + (FigNode) oldEncloser, + (FigNode) newEncloser); + } + + super.setEnclosingFig(newEncloser); + + if (layer != null && newEncloser != oldEncloser) { Diagram diagram = layer.getDiagram(); if (diagram instanceof ArgoDiagram) { - ArgoDiagram umlDiagram = (ArgoDiagram) diagram; - // Set the namespace of the enclosed model element to the - // namespace of the encloser. + ArgoDiagram umlDiagram = (ArgoDiagram) diagram; + // Set the namespace of the enclosed model element to the + // namespace of the encloser. Object namespace = null; if (newEncloser == null) { // The node's been placed on the diagram @@ -821,13 +824,13 @@ } } - if (encloser instanceof FigNodeModelElement) { - ((FigNodeModelElement) encloser).removeEnclosedFig(this); + if (encloser instanceof FigNodeModelElement) { + ((FigNodeModelElement) encloser).removeEnclosedFig(this); } - if (newEncloser instanceof FigNodeModelElement) { - ((FigNodeModelElement) newEncloser).addEnclosedFig(this); + if (newEncloser instanceof FigNodeModelElement) { + ((FigNodeModelElement) newEncloser).addEnclosedFig(this); } - } + } encloser = newEncloser; } @@ -1058,8 +1061,8 @@ SwingUtilities.invokeLater(delayedNotify); } else { LOG.debug("FigNodeModelElement got vetoableChange" - + " from non-owner:" - + src); + + " from non-owner:" + + src); } } @@ -1815,39 +1818,39 @@ } protected void updateStereotypeIcon() { - if (getOwner() == null) { - LOG.warn("Owner of [" + this.toString() + "/" + this.getClass() - + "] is null."); - LOG.warn("I return..."); - return; - } - - if (stereotypeFigProfileIcon != null) { - for (Object fig : getFigs()) { - ((Fig) fig).setVisible(fig != stereotypeFigProfileIcon); - } - - this.removeFig(stereotypeFigProfileIcon); - stereotypeFigProfileIcon = null; - } - - if (originalNameFig != null) { - this.setNameFig(originalNameFig); - originalNameFig = null; - } - - for (Fig icon : floatingStereotypes) { + if (getOwner() == null) { + LOG.warn("Owner of [" + this.toString() + "/" + this.getClass() + + "] is null."); + LOG.warn("I return..."); + return; + } + + if (stereotypeFigProfileIcon != null) { + for (Object fig : getFigs()) { + ((Fig) fig).setVisible(fig != stereotypeFigProfileIcon); + } + + this.removeFig(stereotypeFigProfileIcon); + stereotypeFigProfileIcon = null; + } + + if (originalNameFig != null) { + this.setNameFig(originalNameFig); + originalNameFig = null; + } + + for (Fig icon : floatingStereotypes) { this.removeFig(icon); } floatingStereotypes.clear(); int practicalView = getPracticalView(); - Object modelElement = getOwner(); - Collection stereos = Model.getFacade().getStereotypes(modelElement); - - boolean hiding = - practicalView == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON; + Object modelElement = getOwner(); + Collection stereos = Model.getFacade().getStereotypes(modelElement); + + boolean hiding = + practicalView == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON; if (getStereotypeFig() != null) { getStereotypeFig().setHidingStereotypesWithIcon(hiding); } @@ -1887,8 +1890,8 @@ } } - } else if (practicalView - == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON) { + } else if (practicalView + == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON) { int i = this.getX() + this.getWidth() - ICON_WIDTH - 2; for (Object stereo : stereos) { @@ -1914,13 +1917,13 @@ } // TODO: This is a redundant invocation - updateStereotypeText(); - + updateStereotypeText(); + damage(); - calcBounds(); - updateEdges(); - updateBounds(); - redraw(); + calcBounds(); + updateEdges(); + updateBounds(); + redraw(); } /* @@ -2308,8 +2311,8 @@ * @return true if this is the sole target. */ protected boolean isSingleTarget() { - return TargetManager.getInstance().getSingleModelTarget() - == getOwner(); + return TargetManager.getInstance().getSingleModelTarget() + == getOwner(); } @@ -2339,7 +2342,7 @@ */ private int getPracticalView() { // TODO assert modelElement != null??? - int practicalView = getStereotypeView(); + int practicalView = getStereotypeView(); Object modelElement = getOwner(); if (modelElement != null) { @@ -2420,12 +2423,12 @@ // the stereotypeFigProfileIcon } } else { - setStandardBounds(x, y, w, h); - if (getStereotypeView() - == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON) { - updateSmallIcons(w); - } - } + setStandardBounds(x, y, w, h); + if (getStereotypeView() + == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON) { + updateSmallIcons(w); + } + } } private void updateSmallIcons(int wid) { Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigActor.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigActor.java?view=diff&pathrev=19512&r1=19511&r2=19512 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigActor.java (original) +++ trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigActor.java 2011-05-25 11:06:21-0700 @@ -41,6 +41,7 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Font; +import java.awt.Graphics; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.MouseEvent; @@ -91,6 +92,7 @@ private void constructFigs(Rectangle bounds) { + FigCircle head = new FigCircle(X0 + 2, Y0, 16, 15); FigLine body = new FigLine(X0 + 10, Y0 + 15, 20, 40); @@ -155,6 +157,11 @@ super(owner, bounds, settings); constructFigs(bounds); } + + public void paint(Graphics g) { + forceRepaintShadow(); + super.paint(g); + } @Override public void setLineWidth(int width) { ------------------------------------------------------ http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2747974 To unsubscribe from this discussion, e-mail: [[email protected]].
