01: package org.drools.eclipse.flow.ruleflow.editor.editpart;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: import org.drools.eclipse.DroolsEclipsePlugin;
20: import org.drools.eclipse.flow.common.editor.editpart.ElementEditPart;
21: import org.drools.eclipse.flow.common.editor.editpart.figure.ElementFigure;
22: import org.eclipse.draw2d.IFigure;
23: import org.eclipse.draw2d.LineBorder;
24: import org.eclipse.jface.resource.ImageDescriptor;
25: import org.eclipse.swt.graphics.Image;
26:
27: /**
28: * EditPart for an end node.
29: *
30: * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
31: */
32: public class EndNodeEditPart extends ElementEditPart {
33:
34: protected IFigure createFigure() {
35: return new EndNodeFigure();
36: }
37:
38: public static class EndNodeFigure extends ElementFigure {
39:
40: private static final Image icon = ImageDescriptor
41: .createFromURL(
42: DroolsEclipsePlugin.getDefault().getBundle()
43: .getEntry("icons/process_stop.gif"))
44: .createImage();
45:
46: protected void customizeFigure() {
47: setIcon(icon);
48: setBorder(new LineBorder(1));
49: }
50:
51: public void setSelected(boolean b) {
52: super .setSelected(b);
53: ((LineBorder) getBorder()).setWidth(b ? 3 : 1);
54: repaint();
55: }
56: }
57: }
|