diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java index 45e2c7cdb0c..4b86a21db87 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/policies/UMLTextNonResizableEditPolicy.java @@ -54,9 +54,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl */ @Override protected void showPrimarySelection() { - if(getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel)getHostFigure()).setSelected(true); - ((WrappingLabel)getHostFigure()).setFocus(true); + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(true); } else { showSelection(); showFocus(); @@ -68,9 +68,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl */ @Override protected void showSelection() { - if(getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel)getHostFigure()).setSelected(true); - ((WrappingLabel)getHostFigure()).setFocus(false); + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(false); } else { hideSelection(); addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure()); @@ -85,11 +85,11 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl */ @Override protected void hideSelection() { - if(getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel)getHostFigure()).setSelected(false); - ((WrappingLabel)getHostFigure()).setFocus(false); + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(false); + ((WrappingLabel) getHostFigure()).setFocus(false); } else { - if(selectionFeedbackFigure != null) { + if (selectionFeedbackFigure != null) { removeFeedback(selectionFeedbackFigure); getHostFigure().removeFigureListener(getHostPositionListener()); selectionFeedbackFigure = null; @@ -103,8 +103,8 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl */ @Override protected void showFocus() { - if(getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel)getHostFigure()).setFocus(true); + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(true); } else { hideFocus(); addFeedback(focusFeedbackFigure = createFocusFeedbackFigure()); @@ -117,10 +117,10 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl */ @Override protected void hideFocus() { - if(getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel)getHostFigure()).setFocus(false); + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(false); } else { - if(focusFeedbackFigure != null) { + if (focusFeedbackFigure != null) { removeFeedback(focusFeedbackFigure); focusFeedbackFigure = null; } @@ -132,8 +132,8 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl */ protected Rectangle getFeedbackBounds() { Rectangle bounds; - if(getHostFigure() instanceof Label) { - bounds = ((Label)getHostFigure()).getTextBounds(); + if (getHostFigure() instanceof Label) { + bounds = ((Label) getHostFigure()).getTextBounds(); bounds.intersect(getHostFigure().getBounds()); } else { bounds = getHostFigure().getBounds().getCopy(); @@ -147,7 +147,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl * @generated */ protected IFigure createSelectionFeedbackFigure() { - if(getHostFigure() instanceof Label) { + if (getHostFigure() instanceof Label) { Label feedbackFigure = new Label(); feedbackFigure.setOpaque(true); feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected); @@ -177,7 +177,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl * @generated */ protected void updateLabel(Label target) { - Label source = (Label)getHostFigure(); + Label source = (Label) getHostFigure(); target.setText(source.getText()); target.setTextAlignment(source.getTextAlignment()); target.setFont(source.getFont()); @@ -187,9 +187,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl * @generated */ protected void refreshSelectionFeedback() { - if(selectionFeedbackFigure != null) { - if(selectionFeedbackFigure instanceof Label) { - updateLabel((Label)selectionFeedbackFigure); + if (selectionFeedbackFigure != null) { + if (selectionFeedbackFigure instanceof Label) { + updateLabel((Label) selectionFeedbackFigure); selectionFeedbackFigure.setBounds(getFeedbackBounds()); } else { selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5)); @@ -201,7 +201,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl * @generated */ protected void refreshFocusFeedback() { - if(focusFeedbackFigure != null) { + if (focusFeedbackFigure != null) { focusFeedbackFigure.setBounds(getFeedbackBounds()); } } @@ -219,9 +219,8 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl * @generated */ private FigureListener getHostPositionListener() { - if(hostPositionListener == null) { + if (hostPositionListener == null) { hostPositionListener = new FigureListener() { - @Override public void figureMoved(IFigure source) { refreshFeedback(); @@ -236,7 +235,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl */ @Override protected List<?> createSelectionHandles() { - MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost()); + MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost()); moveHandle.setBorder(null); moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost())); return Collections.singletonList(moveHandle); |