|
Lines 8-196
Link Here
|
| 8 |
import java.util.Map.Entry; |
8 |
import java.util.Map.Entry; |
| 9 |
import java.util.Set; |
9 |
import java.util.Set; |
| 10 |
|
10 |
|
|
|
11 |
import org.eclipse.draw2d.Border; |
| 11 |
import org.eclipse.draw2d.ColorConstants; |
12 |
import org.eclipse.draw2d.ColorConstants; |
| 12 |
import org.eclipse.draw2d.IFigure; |
13 |
import org.eclipse.draw2d.IFigure; |
|
|
14 |
import org.eclipse.draw2d.LineBorder; |
| 15 |
import org.eclipse.draw2d.Polyline; |
| 13 |
import org.eclipse.draw2d.RectangleFigure; |
16 |
import org.eclipse.draw2d.RectangleFigure; |
|
|
17 |
import org.eclipse.draw2d.Shape; |
| 14 |
import org.eclipse.draw2d.geometry.Rectangle; |
18 |
import org.eclipse.draw2d.geometry.Rectangle; |
| 15 |
import org.eclipse.gef.EditPart; |
19 |
import org.eclipse.gef.EditPart; |
| 16 |
import org.eclipse.gef.Request; |
20 |
import org.eclipse.gef.Request; |
| 17 |
import org.eclipse.gef.requests.CreateRequest; |
21 |
import org.eclipse.gef.requests.CreateRequest; |
| 18 |
import org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure; |
22 |
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart; |
| 19 |
import org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure; |
|
|
| 20 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.AbstractExecutionSpecificationEditPart; |
23 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.AbstractExecutionSpecificationEditPart; |
| 21 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.AbstractExecutionSpecificationEditPart.ExecutionSpecificationRectangleFigure; |
|
|
| 22 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart; |
24 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart; |
| 23 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart; |
25 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart; |
| 24 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart; |
26 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart; |
| 25 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart; |
27 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart; |
| 26 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart; |
28 |
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart; |
| 27 |
import org.eclipse.papyrus.uml.diagram.sequence.figures.CombinedFragmentFigure; |
|
|
| 28 |
import org.eclipse.swt.graphics.Color; |
29 |
import org.eclipse.swt.graphics.Color; |
| 29 |
|
30 |
|
| 30 |
|
31 |
|
| 31 |
public class HighlightUtil { |
32 |
public class HighlightUtil { |
|
|
33 |
|
| 34 |
private static class FigureState { |
| 35 |
|
| 36 |
private Color bgColor; |
| 37 |
|
| 38 |
private Color fgColor; |
| 39 |
|
| 40 |
private int lineWidth; |
| 41 |
|
| 42 |
public FigureState(Color bgColor, Color fgColor, int lineWidth) { |
| 43 |
this.bgColor = bgColor; |
| 44 |
this.fgColor = fgColor; |
| 45 |
this.lineWidth = lineWidth; |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 32 |
public static final Color COVER_COLOR = ColorConstants.cyan; |
49 |
public static final Color COVER_COLOR = ColorConstants.cyan; |
|
|
50 |
|
| 33 |
public static final Color TARGET_COLOR = ColorConstants.cyan; |
51 |
public static final Color TARGET_COLOR = ColorConstants.cyan; |
|
|
52 |
|
| 34 |
public static final Color SOURCE_COLOR = ColorConstants.cyan; |
53 |
public static final Color SOURCE_COLOR = ColorConstants.cyan; |
| 35 |
|
54 |
|
| 36 |
static Map<LifelineEditPart, Rectangle> lifelines ; |
55 |
static Map<LifelineEditPart, Rectangle> lifelines; |
|
|
56 |
|
| 37 |
static List<LifelineEditPart> highlightLifelines = new ArrayList<LifelineEditPart>(); |
57 |
static List<LifelineEditPart> highlightLifelines = new ArrayList<LifelineEditPart>(); |
| 38 |
static Map<EditPart,FigureState> figureState = new HashMap<EditPart,FigureState>(); |
|
|
| 39 |
|
58 |
|
|
|
59 |
static Map<EditPart, FigureState> feedbackStates = new HashMap<EditPart, HighlightUtil.FigureState>(); |
| 60 |
|
| 40 |
public static Map<LifelineEditPart, Rectangle> collectAllLifelines(EditPart part) { |
61 |
public static Map<LifelineEditPart, Rectangle> collectAllLifelines(EditPart part) { |
| 41 |
Map<LifelineEditPart,Rectangle> lifelines = new HashMap<LifelineEditPart,Rectangle>(); |
62 |
Map<LifelineEditPart, Rectangle> lifelines = new HashMap<LifelineEditPart, Rectangle>(); |
| 42 |
Set<Entry<Object, EditPart>> allEditPartEntries = part.getViewer().getEditPartRegistry().entrySet(); |
63 |
Set<Entry<Object, EditPart>> allEditPartEntries = part.getViewer().getEditPartRegistry().entrySet(); |
| 43 |
for(Entry<Object, EditPart> epEntry : allEditPartEntries) { |
64 |
for(Entry<Object, EditPart> epEntry : allEditPartEntries) { |
| 44 |
EditPart ep = epEntry.getValue(); |
65 |
EditPart ep = epEntry.getValue(); |
| 45 |
if(!(ep instanceof LifelineEditPart)) |
66 |
if(!(ep instanceof LifelineEditPart)) |
| 46 |
continue; |
67 |
continue; |
| 47 |
|
68 |
|
| 48 |
LifelineEditPart lp = (LifelineEditPart)ep; |
69 |
LifelineEditPart lp = (LifelineEditPart)ep; |
| 49 |
IFigure figure = lp.getFigure(); |
70 |
IFigure figure = lp.getFigure(); |
| 50 |
Rectangle childBounds = figure.getBounds().getCopy(); |
71 |
Rectangle childBounds = figure.getBounds().getCopy(); |
| 51 |
figure.translateToAbsolute(childBounds); |
72 |
figure.translateToAbsolute(childBounds); |
| 52 |
Rectangle centralLineBounds = new Rectangle( |
73 |
Rectangle centralLineBounds = new Rectangle(childBounds.x() + childBounds.width() / 2, childBounds.y(), 1, childBounds.height()); |
| 53 |
childBounds.x() + childBounds.width() / 2, |
74 |
|
| 54 |
childBounds.y(), 1, childBounds.height()); |
75 |
lifelines.put(lp, centralLineBounds); |
| 55 |
|
|
|
| 56 |
lifelines.put(lp, centralLineBounds); |
| 57 |
} |
76 |
} |
| 58 |
return lifelines; |
77 |
return lifelines; |
| 59 |
} |
78 |
} |
| 60 |
|
79 |
|
| 61 |
public static void showSizeOnDropFeedback(CreateRequest request,EditPart host, IFigure feedback, Rectangle bounds){ |
80 |
public static void eraseSizeOnDropFeedback(Request request, EditPart host) { |
| 62 |
if(lifelines == null){ |
81 |
for(LifelineEditPart lp : highlightLifelines) { |
|
|
82 |
FigureState s = feedbackStates.get(lp); |
| 83 |
if(s == null) |
| 84 |
continue; |
| 85 |
|
| 86 |
RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); |
| 87 |
rect.setBackgroundColor(s.bgColor); |
| 88 |
rect.setFill(true); |
| 89 |
} |
| 90 |
|
| 91 |
lifelines = null; |
| 92 |
highlightLifelines = new ArrayList<LifelineEditPart>(); |
| 93 |
} |
| 94 |
|
| 95 |
public static void showSizeOnDropFeedback(CreateRequest request, EditPart host, IFigure feedback, Rectangle bounds) { |
| 96 |
if(lifelines == null) { |
| 63 |
lifelines = collectAllLifelines(host); |
97 |
lifelines = collectAllLifelines(host); |
| 64 |
highlightLifelines = new ArrayList<LifelineEditPart>(); |
98 |
highlightLifelines = new ArrayList<LifelineEditPart>(); |
| 65 |
} |
99 |
} |
| 66 |
|
100 |
|
| 67 |
List<LifelineEditPart> addLifelines = new ArrayList<LifelineEditPart>(); |
101 |
List<LifelineEditPart> addLifelines = new ArrayList<LifelineEditPart>(); |
| 68 |
List<LifelineEditPart> removeLifelines = new ArrayList<LifelineEditPart>(); |
102 |
List<LifelineEditPart> removeLifelines = new ArrayList<LifelineEditPart>(); |
| 69 |
|
103 |
|
| 70 |
Iterator<Entry<LifelineEditPart, Rectangle>> it = lifelines.entrySet().iterator(); |
104 |
Iterator<Entry<LifelineEditPart, Rectangle>> it = lifelines.entrySet().iterator(); |
| 71 |
while(it.hasNext()){ |
105 |
while(it.hasNext()) { |
| 72 |
Entry<LifelineEditPart, Rectangle> en = it.next(); |
106 |
Entry<LifelineEditPart, Rectangle> en = it.next(); |
| 73 |
|
107 |
|
| 74 |
if(bounds.intersects(en.getValue())){ |
108 |
if(bounds.intersects(en.getValue())) { |
| 75 |
if(!highlightLifelines.contains(en.getKey())) |
109 |
if(!highlightLifelines.contains(en.getKey())) |
| 76 |
addLifelines.add(en.getKey()); |
110 |
addLifelines.add(en.getKey()); |
| 77 |
}else{ |
111 |
} else { |
| 78 |
if(highlightLifelines.contains(en.getKey())) |
112 |
if(highlightLifelines.contains(en.getKey())) |
| 79 |
removeLifelines.add(en.getKey()); |
113 |
removeLifelines.add(en.getKey()); |
| 80 |
} |
114 |
} |
| 81 |
} |
115 |
} |
| 82 |
|
116 |
|
| 83 |
highlightLifelines.removeAll(removeLifelines); |
117 |
highlightLifelines.removeAll(removeLifelines); |
| 84 |
highlightLifelines.addAll(addLifelines); |
118 |
highlightLifelines.addAll(addLifelines); |
| 85 |
|
119 |
|
| 86 |
// highlight lifeline inside |
120 |
// highlight lifeline inside |
| 87 |
for(LifelineEditPart lp : addLifelines){ |
121 |
for(LifelineEditPart lp : addLifelines) { |
| 88 |
RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); |
122 |
RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); |
| 89 |
figureState.put(lp, new FigureState(rect.getBackgroundColor())); |
123 |
feedbackStates.put(lp, new FigureState(rect.getBackgroundColor(), rect.getForegroundColor(), rect.getLineWidth())); |
| 90 |
rect.setBackgroundColor(COVER_COLOR); |
124 |
rect.setBackgroundColor(COVER_COLOR); |
| 91 |
rect.setFill(true); |
125 |
rect.setFill(true); |
| 92 |
} |
126 |
} |
| 93 |
|
127 |
|
| 94 |
// restore lifeline outside |
128 |
// restore lifeline outside |
| 95 |
for(LifelineEditPart lp : removeLifelines){ |
129 |
for(LifelineEditPart lp : removeLifelines) { |
| 96 |
FigureState s = figureState.get(lp); |
130 |
FigureState s = feedbackStates.get(lp); |
| 97 |
if(s == null) |
131 |
if(s == null) |
| 98 |
continue; |
132 |
continue; |
| 99 |
|
|
|
| 100 |
RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); |
| 101 |
rect.setBackgroundColor(s.bgColor); |
| 102 |
rect.setFill(true); |
| 103 |
} |
| 104 |
} |
| 105 |
|
133 |
|
| 106 |
public static void eraseSizeOnDropFeedback(Request request, EditPart host) { |
|
|
| 107 |
for(LifelineEditPart lp : highlightLifelines){ |
| 108 |
FigureState s = figureState.get(lp); |
| 109 |
if(s == null) |
| 110 |
continue; |
| 111 |
|
| 112 |
RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); |
134 |
RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); |
| 113 |
rect.setBackgroundColor(s.bgColor); |
135 |
rect.setBackgroundColor(s.bgColor); |
| 114 |
rect.setFill(true); |
136 |
rect.setFill(true); |
| 115 |
} |
137 |
} |
| 116 |
|
|
|
| 117 |
lifelines = null; |
| 118 |
highlightLifelines = new ArrayList<LifelineEditPart>(); |
| 119 |
} |
138 |
} |
| 120 |
|
139 |
|
| 121 |
public static void showConnectionFeedback(EditPart host, Color color) { |
140 |
private Map<Object, FigureState> figureState = new HashMap<Object, FigureState>(); |
| 122 |
if(host instanceof LifelineEditPart){ |
141 |
|
|
|
142 |
/** |
| 143 |
* Maybe this value can be managed by preferences. |
| 144 |
*/ |
| 145 |
private Color getHighlightBackground() { |
| 146 |
return null; |
| 147 |
} |
| 148 |
|
| 149 |
/** |
| 150 |
* Maybe this value can be managed by preferences. |
| 151 |
*/ |
| 152 |
private int getHighlightBorderWidth() { |
| 153 |
return 2; |
| 154 |
} |
| 155 |
|
| 156 |
private List<IFigure> getHighlightFigures(EditPart host) { |
| 157 |
List<IFigure> figures = new ArrayList<IFigure>(); |
| 158 |
if(host instanceof LifelineEditPart) { |
| 123 |
LifelineEditPart part = (LifelineEditPart)host; |
159 |
LifelineEditPart part = (LifelineEditPart)host; |
| 124 |
RectangleFigure fig = part.getPrimaryShape().getFigureLifelineNameContainerFigure(); |
160 |
figures.add(part.getPrimaryShape().getFigureLifelineNameContainerFigure()); |
| 125 |
saveIfNotExist(host, fig); |
161 |
figures.add(part.getPrimaryShape().getFigureLifelineDotLineFigure()); |
| 126 |
fig.setBackgroundColor(color); |
162 |
} else if(host instanceof AbstractExecutionSpecificationEditPart) { |
| 127 |
fig.setFill(true); |
163 |
figures.add(((AbstractExecutionSpecificationEditPart)host).getPrimaryShape()); |
| 128 |
}else if(host instanceof AbstractExecutionSpecificationEditPart){ |
164 |
} else if(host instanceof CombinedFragmentEditPart) { |
| 129 |
ExecutionSpecificationRectangleFigure fig = ((AbstractExecutionSpecificationEditPart)host).getPrimaryShape(); |
165 |
figures.add(((CombinedFragmentEditPart)host).getPrimaryShape()); |
| 130 |
saveIfNotExist(host, fig); |
166 |
} else if(host instanceof InteractionOperandEditPart) { |
| 131 |
fig.setBackgroundColor(color); |
167 |
InteractionOperandEditPart op = (InteractionOperandEditPart)host; |
| 132 |
}else if(host instanceof CombinedFragmentEditPart){ |
168 |
CombinedFragmentEditPart cep = (CombinedFragmentEditPart)op.getParent().getParent(); |
| 133 |
CombinedFragmentFigure fig = ((CombinedFragmentEditPart)host).getPrimaryShape(); |
169 |
figures.add(cep.getPrimaryShape()); |
| 134 |
saveIfNotExist(host, fig); |
170 |
} else if(host instanceof CommentEditPart) { |
| 135 |
fig.setBackgroundColor(color); |
171 |
figures.add(((CommentEditPart)host).getPrimaryShape()); |
| 136 |
}else if(host instanceof InteractionOperandEditPart){ |
172 |
} else if(host instanceof ConstraintEditPart) { |
| 137 |
InteractionOperandEditPart op = (InteractionOperandEditPart) host; |
173 |
figures.add(((ConstraintEditPart)host).getPrimaryShape()); |
| 138 |
CombinedFragmentEditPart cep = (CombinedFragmentEditPart) op.getParent().getParent(); |
174 |
} else if(host instanceof IPapyrusEditPart) { |
| 139 |
CombinedFragmentFigure fig = cep.getPrimaryShape(); |
175 |
figures.add(((IPapyrusEditPart)host).getPrimaryShape()); |
| 140 |
saveIfNotExist(host, fig); |
|
|
| 141 |
fig.setBackgroundColor(color); |
| 142 |
}else if(host instanceof CommentEditPart){ |
| 143 |
HTMLCornerBentFigure fig = ((CommentEditPart)host).getPrimaryShape(); |
| 144 |
saveIfNotExist(host, fig); |
| 145 |
fig.setBackgroundColor(color); |
| 146 |
}else if(host instanceof ConstraintEditPart){ |
| 147 |
ConstraintFigure fig = ( (ConstraintEditPart) host).getPrimaryShape(); |
| 148 |
saveIfNotExist(host, fig); |
| 149 |
fig.setBackgroundColor(color); |
| 150 |
} |
176 |
} |
|
|
177 |
return figures; |
| 151 |
} |
178 |
} |
| 152 |
|
179 |
|
| 153 |
protected static void saveIfNotExist(EditPart host, IFigure fig) { |
180 |
/** |
| 154 |
if(!figureState.containsKey(host)) |
181 |
* Maybe this value can be managed by preferences. |
| 155 |
figureState.put(host, new FigureState(fig.getBackgroundColor())); |
182 |
*/ |
|
|
183 |
private Color getHighlightForeground() { |
| 184 |
return null; |
| 156 |
} |
185 |
} |
| 157 |
|
186 |
|
| 158 |
public static void eraseConnectionFeedback(EditPart host) { |
187 |
public void highlight(EditPart host) { |
| 159 |
FigureState s = figureState.get(host); |
188 |
List<IFigure> highlightFigures = getHighlightFigures(host); |
| 160 |
if(s == null) |
189 |
if(highlightFigures.isEmpty()) { |
| 161 |
return; |
190 |
return; |
| 162 |
|
191 |
} |
| 163 |
if(host instanceof LifelineEditPart){ |
192 |
|
| 164 |
LifelineEditPart part = (LifelineEditPart)host; |
193 |
Color background = getHighlightBackground(); |
| 165 |
RectangleFigure fig = part.getPrimaryShape().getFigureLifelineNameContainerFigure(); |
194 |
Color foreground = getHighlightForeground(); |
| 166 |
fig.setBackgroundColor(s.bgColor); |
195 |
int lineWidth = getHighlightBorderWidth(); |
| 167 |
fig.setFill(true); |
196 |
for(IFigure figure : highlightFigures) { |
| 168 |
}else if(host instanceof AbstractExecutionSpecificationEditPart){ |
197 |
saveIfNotExist(figure, figure); |
| 169 |
ExecutionSpecificationRectangleFigure fig = ((AbstractExecutionSpecificationEditPart)host).getPrimaryShape(); |
198 |
updateFigure(figure, background, foreground, lineWidth); |
| 170 |
fig.setBackgroundColor(s.bgColor); |
|
|
| 171 |
}else if(host instanceof CombinedFragmentEditPart){ |
| 172 |
CombinedFragmentEditPart cep = (CombinedFragmentEditPart)host; |
| 173 |
cep.getPrimaryShape().setBackgroundColor(s.bgColor); |
| 174 |
}else if(host instanceof InteractionOperandEditPart){ |
| 175 |
InteractionOperandEditPart op = (InteractionOperandEditPart) host; |
| 176 |
CombinedFragmentEditPart cep = (CombinedFragmentEditPart) op.getParent().getParent(); |
| 177 |
cep.getPrimaryShape().setBackgroundColor(s.bgColor); |
| 178 |
}else if(host instanceof CommentEditPart){ |
| 179 |
HTMLCornerBentFigure fig = ((CommentEditPart)host).getPrimaryShape(); |
| 180 |
fig.setBackgroundColor(s.bgColor); |
| 181 |
}else if(host instanceof ConstraintEditPart){ |
| 182 |
ConstraintFigure fig = ( (ConstraintEditPart) host).getPrimaryShape(); |
| 183 |
fig.setBackgroundColor(s.bgColor); |
| 184 |
} |
199 |
} |
| 185 |
|
|
|
| 186 |
figureState.remove(host); |
| 187 |
} |
200 |
} |
| 188 |
|
201 |
|
| 189 |
static class FigureState{ |
202 |
protected void saveIfNotExist(Object host, IFigure fig) { |
| 190 |
Color bgColor; |
203 |
if(!figureState.containsKey(host)) { |
| 191 |
|
204 |
int lineWidth = 1; |
| 192 |
public FigureState(Color bgColor) { |
205 |
Border border = fig.getBorder(); |
| 193 |
this.bgColor = bgColor; |
206 |
if(border instanceof LineBorder) { |
|
|
207 |
lineWidth = ((LineBorder)border).getWidth(); |
| 208 |
} else if(fig instanceof Shape) { |
| 209 |
lineWidth = ((Shape)fig).getLineWidth(); |
| 210 |
} |
| 211 |
figureState.put(host, new FigureState(fig.getBackgroundColor(), fig.getForegroundColor(), lineWidth)); |
| 194 |
} |
212 |
} |
| 195 |
} |
213 |
} |
|
|
214 |
|
| 215 |
public void unhighlight() { |
| 216 |
if(figureState == null || figureState.isEmpty()) { |
| 217 |
return; |
| 218 |
} |
| 219 |
Set<Entry<Object, FigureState>> entrySet = figureState.entrySet(); |
| 220 |
for(Entry<Object, FigureState> entry : entrySet) { |
| 221 |
Object key = entry.getKey(); |
| 222 |
FigureState value = entry.getValue(); |
| 223 |
if(key instanceof IFigure) { |
| 224 |
IFigure fig = (IFigure)key; |
| 225 |
updateFigure(fig, value.bgColor, value.fgColor, value.lineWidth); |
| 226 |
} else if(key instanceof EditPart) { |
| 227 |
List<IFigure> figures = getHighlightFigures((EditPart)key); |
| 228 |
for(IFigure fig : figures) { |
| 229 |
updateFigure(fig, value.bgColor, value.fgColor, value.lineWidth); |
| 230 |
} |
| 231 |
} |
| 232 |
} |
| 233 |
figureState.clear(); |
| 234 |
} |
| 235 |
|
| 236 |
public void unhighlight(EditPart host) { |
| 237 |
List<IFigure> highlightFigures = getHighlightFigures(host); |
| 238 |
if(highlightFigures.isEmpty()) { |
| 239 |
return; |
| 240 |
} |
| 241 |
for(IFigure figure : highlightFigures) { |
| 242 |
FigureState s = figureState.remove(figure); |
| 243 |
if(s == null) { |
| 244 |
continue; |
| 245 |
} |
| 246 |
updateFigure(figure, s.bgColor, s.fgColor, s.lineWidth); |
| 247 |
} |
| 248 |
} |
| 249 |
|
| 250 |
private void updateFigure(IFigure fig, Color bgColor, Color fgColor, int lineWidth) { |
| 251 |
if(fig == null) { |
| 252 |
return; |
| 253 |
} |
| 254 |
if(lineWidth > 0) { |
| 255 |
Border border = fig.getBorder(); |
| 256 |
if(border != null && border instanceof LineBorder) { |
| 257 |
((LineBorder)border).setWidth(lineWidth); |
| 258 |
} else if(fig instanceof Shape) { |
| 259 |
((Shape)fig).setLineWidth(lineWidth); |
| 260 |
} else if(fig instanceof Polyline) { |
| 261 |
((Polyline)fig).setLineWidth(lineWidth); |
| 262 |
} |
| 263 |
} |
| 264 |
if(bgColor != null) { |
| 265 |
fig.setBackgroundColor(bgColor); |
| 266 |
} |
| 267 |
if(fgColor != null) { |
| 268 |
fig.setForegroundColor(fgColor); |
| 269 |
} |
| 270 |
fig.repaint(); |
| 271 |
} |
| 196 |
} |
272 |
} |