Author: max.andersen(a)jboss.com
Date: 2008-06-06 09:23:22 -0400 (Fri, 06 Jun 2008)
New Revision: 8609
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFeedbackFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java
Log:
JBIDE-2280 gradient box instead of stickit note
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java 2008-06-06
12:36:20 UTC (rev 8608)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java 2008-06-06
13:23:22 UTC (rev 8609)
@@ -162,7 +162,7 @@
protected void refreshVisuals() {
Point loc = getExceptionModel().getLocation();
String text = getExceptionReadOnlyLabel();
- int width = getIconWidth()+FigureUtilities.getTextExtents(text,
NodeFigure.exceptionFont).width;
+ int width = getIconWidth()+FigureUtilities.getTextExtents(text,
NodeFigure.nodeLabelFont).width;
size = new Dimension(width, getVisualHeight());
adjustForGrid(loc);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-06-06
12:36:20 UTC (rev 8608)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-06-06
13:23:22 UTC (rev 8609)
@@ -165,7 +165,7 @@
if (getPageModel().getOutputLinks().size() == 0)
height = 23 + NodeFigure.LINK_HEIGHT;
- size = new Dimension(50, height);
+ size = new Dimension(getFigure().getPreferredSize().width, height);
adjustForGrid(loc);
Rectangle r = new Rectangle(loc, size);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java 2008-06-06
12:36:20 UTC (rev 8608)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java 2008-06-06
13:23:22 UTC (rev 8609)
@@ -154,7 +154,7 @@
Point loc = getExceptionModel().getLocation();
String text = getExceptionModel().getName();
if(text == null) text="Param";
- int width = getIconWidth()+FigureUtilities.getTextExtents(text,
NodeFigure.exceptionFont).width;
+ int width = getIconWidth()+FigureUtilities.getTextExtents(text,
NodeFigure.nodeLabelFont).width;
size = new Dimension(width, getVisualHeight());
adjustForGrid(loc);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java 2008-06-06
12:36:20 UTC (rev 8608)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java 2008-06-06
13:23:22 UTC (rev 8609)
@@ -120,7 +120,7 @@
g.drawImage(icon, 4, 2);
if(exc != null){
- g.setFont(exceptionFont);
+ g.setFont(nodeLabelFont);
g.drawString(getExceptionReadOnlyLabel(), 27, 3);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java 2008-06-06
12:36:20 UTC (rev 8608)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java 2008-06-06
13:23:22 UTC (rev 8609)
@@ -66,7 +66,7 @@
public static final Color button3Color = new Color(null, 0xff, 0xe8, 0x79);
public static final Color button4Color = new Color(null, 0xdb, 0xc7, 0x68);
- public static final Font exceptionFont = new Font(null, "default", 8,
SWT.BOLD);
+ public static final Font nodeLabelFont = new Font(null, "default", 10,
SWT.BOLD); // TODO: use preference font mechanism for this
public static final Image errorIcon = ModelUIImages
.getImage("error_co.gif");
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFeedbackFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFeedbackFigure.java 2008-06-06
12:36:20 UTC (rev 8608)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFeedbackFigure.java 2008-06-06
13:23:22 UTC (rev 8609)
@@ -33,7 +33,7 @@
g.fillRectangle(start+1,1,22,19);
- g.fillPolygon(fillPointlist);
+ //g.fillPolygon(fillPointlist);
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-06-06
12:36:20 UTC (rev 8608)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-06-06
13:23:22 UTC (rev 8609)
@@ -1,337 +1,373 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.ui.pages.editor.figures;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.draw2d.*;
-import org.eclipse.draw2d.geometry.*;
-
-import org.eclipse.gef.handles.HandleBounds;
-
-import org.jboss.tools.common.gef.GEFGraphicalViewer;
-import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
-import org.jboss.tools.seam.ui.pages.editor.edit.PageEditPart;
-import org.jboss.tools.seam.ui.pages.editor.figures.xpl.FixedConnectionAnchor;
-import org.jboss.tools.seam.ui.pages.editor.print.PrintIconHelper;
-
-public class PageFigure extends NodeFigure implements HandleBounds,
- FigureListener {
- private static final Dimension SIZE = new Dimension(56, 100);
-
- private Image icon = null;
-
- public Page page;
-
- private Label label = null;
-
- PointList fillPointlist, fill2Pointlist, shadowPointlist, shadow2Pointlist;
-
- String path;
-
- PageEditPart editPart;
-
- public void setGroupEditPart(PageEditPart part) {
- editPart = part;
- }
-
- public void setBounds(Rectangle rect) {
- super.setBounds(rect);
- resizeFigure();
- }
-
- public void setConstraint(IFigure child, Object constraint) {
- super.setConstraint(child, constraint);
- }
-
- public void setPath(String path) {
- this.path = path;
- if (label != null) {
- label.setText(path);
- label.setSize(label.getPreferredSize());
- }
- }
-
- public void refreshFont() {
- if (label != null) {
- //label.setFont(group.getJSFModel().getOptions().getViewPathFont());
- label.setSize(label.getPreferredSize());
- label.setLocation(new Point(getLocation().x - 5, getLocation().y
- - (12 + 10)));
- }
- }
-
- public void setIcon(Image i) {
- icon = PrintIconHelper.getPrintImage(i);
- }
-
- public void addNotify() {
- if (page == null)
- return;
- label = new Label(path);
- //label.setFont(group.getJSFModel().getOptions().getViewPathFont());
- getParent().add(label);
- label.setForegroundColor(ColorConstants.black);
- label.setOpaque(false);
- label.setText(path);
- label.setVisible(true);
- label.setSize(label.getPreferredSize());
- label.setLocation(new Point(getLocation().x - 5, getLocation().y
- - (12 + 10)));
- //label.addMouseListener(this);
- }
-
- public void removeNotify() {
- if (page == null)
- return;
- //label.removeMouseListener(this);
- getParent().remove(label);
- }
-
- public void figureMoved(IFigure source) {
- if (page != null)
- label.setLocation(new Point(getLocation().x - 5,
- getLocation().y - 20));
- }
-
- public PageFigure(Page group) {
- this.page = group;
-
- if (group != null) {
- setIcon(group.getImage());
- setPath(group.getName());
- initConnectionAnchors(group.getOutputLinks().size());
- }
-
- setOpaque(false);
- setLayoutManager(new XYLayout());
-
- resizeFigure();
- addFigureListener(this);
- //addKeyListener(this);
- setBorder(new GroupBorder(blackColor));
-
- if (group != null) {
- FixedConnectionAnchor c;
- c = new FixedConnectionAnchor(this);
- c.offsetV = 8;
- c.offsetH = -1;
- connectionAnchors.put("1_IN", c);
- inputConnectionAnchors.addElement(c);
-
- }
- }
- public ConnectionAnchor getConnectionAnchor(String terminal) {
- ConnectionAnchor anchor = (ConnectionAnchor)connectionAnchors.get(terminal);
- while(anchor == null){
- addConnectionAnchor(outputConnectionAnchors.size());
- anchor = (ConnectionAnchor)connectionAnchors.get(terminal);
- }
- return anchor;
- }
- /**
- * @see org.eclipse.gef.handles.HandleBounds#getHandleBounds()
- */
- public Rectangle getHandleBounds() {
- return getBounds().getCropped(new Insets(0, 0, 0, 0));
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#getPreferredSize(int, int)
- */
- public Dimension getPreferredSize(int wHint, int hHint) {
- return SIZE;
- }
-
- int width, height;
-
- private void resizeFigure() {
- if (width == getSize().width && height == getSize().height)
- return;
-
- int start = 0;
- width = getSize().width - 1;
- height = getSize().height - 1;
-
-
- fillPointlist = new PointList();
-
- fillPointlist.addPoint(start, 20);
- fillPointlist.addPoint(start + 23, 20);
- fillPointlist.addPoint(start + 23, 0);
- fillPointlist.addPoint(width - 15, 0);
- fillPointlist.addPoint(width - 1, 14);
- fillPointlist.addPoint(width - 1, height - 1);
- fillPointlist.addPoint(start, height - 1);
-
-
-
- shadowPointlist = new PointList();
-
- shadowPointlist.addPoint(width - 15, 0);
- shadowPointlist.addPoint(width - 14, 4);
- shadowPointlist.addPoint(width - 15, 7);
- shadowPointlist.addPoint(width - 18, 10);
- shadowPointlist.addPoint(width - 1, 14);
-
- shadowPointlist.addPoint(width - 9, 14);
- shadowPointlist.addPoint(width - 16, 13);
-
- shadowPointlist.addPoint(width - 21, 11);
- shadowPointlist.addPoint(width - 18, 8);
- shadowPointlist.addPoint(width - 16, 4);
-
- shadow2Pointlist = new PointList();
-
- shadow2Pointlist.addPoint(width - 15, 0);
- shadow2Pointlist.addPoint(width - 1, 14);
- shadow2Pointlist.addPoint(width - 3, 14);
- shadow2Pointlist.addPoint(width - 15, 2);
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#paintFigure(Graphics)
- */
- protected void paintFigure(Graphics g) {
- Rectangle r = getBounds().getCopy();
- g.translate(r.getLocation());
-
- int height = r.height - 1;
- int start = 0;
-
-
- g.setBackgroundColor(whiteColor);
-
- g.fillRectangle(start + 1, 1, 22, 19);
-
- if (icon != null)
- g.drawImage(icon, start + 4, 2);
-
-
- if (page != null /*&& group.isConfirmed()*/) {
- g.setBackgroundColor(yellowColor);
- } else {
- g.setBackgroundColor(lightGrayColor);
- }
-
- g.fillPolygon(fillPointlist);
-
-
- if (page != null /*&& group.isConfirmed()*/) {
- g.setBackgroundColor(orangeColor);
- } else {
- g.setBackgroundColor(lightGrayColor);
- }
-
- g.fillPolygon(shadowPointlist);
- g.fillPolygon(shadow2Pointlist);
-
- if(page.getChildren().size() != 0){
- if(page.isParamsVisible()){
- g.setForegroundColor(blackColor);
- g.drawLine(4, height-13, 11, height-13);
- g.drawLine(4, height-13, 4, height-6);
-
- g.drawLine(6, height-9, 10, height-9);
-
- g.setForegroundColor(button2Color);
- g.drawLine(12, height-13, 12, height-5);
- g.drawLine(4, height-5, 12, height-5);
-
- g.setForegroundColor(button3Color);
- g.setBackgroundColor(button3Color);
- g.drawLine(5, height-4, 13, height-4);
- g.drawLine(13, height-4, 13, height-12);
- g.fillRectangle(6, height-11, 5, 2);
- g.fillRectangle(6, height-8, 5, 2);
-
- g.setForegroundColor(button4Color);
- g.drawLine(5, height-7, 5, height-12);
- g.drawLine(5, height-12, 10, height-12);
- }else{
-
- g.setForegroundColor(button2Color);
- g.drawLine(4, height-13, 11, height-13);
- g.drawLine(4, height-13, 4, height-6);
-
- g.setForegroundColor(blackColor);
-
- g.drawLine(6, height-9, 10, height-9);
- g.drawLine(8, height-11, 8, height-7);
-
- g.drawLine(12, height-13, 12, height-5);
- g.drawLine(4, height-5, 12, height-5);
-
- g.setForegroundColor(button3Color);
- g.drawLine(5, height-4, 13, height-4);
- g.drawLine(13, height-4, 13, height-12);
-
- g.drawLine(6, height-6, 11, height-6);
- g.drawLine(11, height-6, 11, height-12);
-
- g.setForegroundColor(whiteColor);
- g.drawLine(5, height-6, 5, height-12);
- g.drawLine(5, height-12, 11, height-12);
- }
- }
- }
-
- class GroupBorder extends LineBorder {
- public GroupBorder(Color color) {
- super(color);
- }
-
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- Rectangle r = getPaintRectangle(figure, insets).getCopy();
- graphics.translate(r.getLocation());
- int width = r.width - 1;
- int height = r.height - 1;
-
- if (page != null /*&& group.isConfirmed()*/)
- graphics.setForegroundColor(blackColor);
- else
- graphics.setForegroundColor(darkGrayColor);
-
- graphics.drawLine(1, 0, width - 15, 0);
- graphics.drawLine(0, 1, 0, height - 2);
- graphics.drawLine(1, height - 1, width - 2, height - 1);
- graphics.drawLine(width - 1, 14, width - 1, height - 2);
- graphics.drawLine(width - 15, 0, width - 1, 14);
-
- graphics.drawLine(0, 1, 1, 0);
- graphics.drawLine(0, height - 2, 1, height - 1);
- graphics.drawLine(width - 2, height - 1, width - 1, height - 2);
-
- graphics.drawLine(width - 15, 0, width - 14, 4);
- graphics.drawLine(width - 14, 4, width - 15, 7);
- graphics.drawLine(width - 15, 7, width - 18, 10);
-
- graphics.drawLine(width - 18, 10, width - 1, 14);
-
- graphics.drawLine(23, 0, 23, 19);
- graphics.drawLine(0, 20, 22, 20);
- graphics.drawLine(22, 20, 23, 19);
- }
-
- public void mouseDoubleClicked(MouseEvent me) {
- }
-
- public void mousePressed(MouseEvent me) {
- if (me.button == 3) {
- ((GEFGraphicalViewer) editPart.getViewer()).setNoDeselect();
- editPart.getViewer().select(editPart);
- }
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.pages.editor.figures;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.widgets.Display;
+
+import org.eclipse.draw2d.*;
+import org.eclipse.draw2d.geometry.*;
+
+import org.eclipse.gef.handles.HandleBounds;
+
+import org.jboss.tools.common.gef.GEFGraphicalViewer;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
+import org.jboss.tools.seam.ui.pages.editor.edit.PageEditPart;
+import org.jboss.tools.seam.ui.pages.editor.figures.xpl.FixedConnectionAnchor;
+import org.jboss.tools.seam.ui.pages.editor.print.PrintIconHelper;
+
+public class PageFigure extends NodeFigure implements HandleBounds,
+ FigureListener {
+ private static final Dimension SIZE = new Dimension(56, 100);
+
+ private Image icon = null;
+
+ public Page page;
+
+ private Label label = null;
+
+ //PointList fillPointlist, fill2Pointlist, shadowPointlist, shadow2Pointlist;
+
+ String path;
+
+ PageEditPart editPart;
+
+ public void setGroupEditPart(PageEditPart part) {
+ editPart = part;
+ }
+
+ public void setBounds(Rectangle rect) {
+ super.setBounds(rect);
+ resizeFigure();
+
+ }
+
+ public void setConstraint(IFigure child, Object constraint) {
+ super.setConstraint(child, constraint);
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ if (label != null) {
+ label.setText(path);
+ label.setSize(label.getPreferredSize());
+ }
+ }
+
+ public void refreshFont() {
+ if (label != null) {
+ //label.setFont(group.getJSFModel().getOptions().getViewPathFont());
+ label.setSize(label.getPreferredSize());
+ label.setLocation(getLabelPosition());
+ }
+ }
+
+ private Point getLabelPosition() {
+ //return new Point(getLocation().x - 5, getLocation().y
+ // - (12 + 10));
+ return new Point((getInsetX()*3)+ icon.getBounds().width + getLocation().x ,
getLocation().y + getInsetY());
+
+ }
+
+ public void setIcon(Image i) {
+ icon = PrintIconHelper.getPrintImage(i);
+ }
+
+ public void addNotify() {
+ if (page == null)
+ return;
+ label = new Label(path);
+ label.setFont(nodeLabelFont);
+ getParent().add(label);
+ label.setForegroundColor(ColorConstants.black);
+ label.setOpaque(false);
+ label.setText(path);
+ label.setVisible(true);
+ label.setSize(label.getPreferredSize());
+ label.setLocation(getLabelPosition());
+ //label.addMouseListener(this);
+ }
+
+ public void removeNotify() {
+ if (page == null)
+ return;
+ //label.removeMouseListener(this);
+ getParent().remove(label);
+ }
+
+ public void figureMoved(IFigure source) {
+ if (page != null)
+ label.setLocation(getLabelPosition());
+ }
+
+ public PageFigure(Page group) {
+ this.page = group;
+
+ if (group != null) {
+ setIcon(group.getImage());
+ setPath(group.getName());
+ initConnectionAnchors(group.getOutputLinks().size());
+ }
+
+ setOpaque(false);
+ setLayoutManager(new XYLayout());
+
+ resizeFigure();
+ addFigureListener(this);
+ //addKeyListener(this);
+ setBorder(new GroupBorder(blackColor));
+
+ if (group != null) {
+ FixedConnectionAnchor c;
+ c = new FixedConnectionAnchor(this);
+ c.offsetV = 8;
+ c.offsetH = -1;
+ connectionAnchors.put("1_IN", c);
+ inputConnectionAnchors.addElement(c);
+
+ }
+ }
+ public ConnectionAnchor getConnectionAnchor(String terminal) {
+ ConnectionAnchor anchor = (ConnectionAnchor)connectionAnchors.get(terminal);
+ while(anchor == null){
+ addConnectionAnchor(outputConnectionAnchors.size());
+ anchor = (ConnectionAnchor)connectionAnchors.get(terminal);
+ }
+ return anchor;
+ }
+ /**
+ * @see org.eclipse.gef.handles.HandleBounds#getHandleBounds()
+ */
+ public Rectangle getHandleBounds() {
+ return getBounds().getCropped(new Insets(0, 0, 0, 0));
+ }
+
+ /**
+ * @see org.eclipse.draw2d.Figure#getPreferredSize(int, int)
+ */
+ public Dimension getPreferredSize(int wHint, int hHint) {
+ return new Dimension(icon.getBounds().width
+ + label.getBounds().width
+ + 40 /** the bend corner width */, label.getBounds().height);
+ }
+
+ int width, height;
+
+ private void resizeFigure() {
+ if (width == getSize().width && height == getSize().height)
+ return;
+
+ int start = 0;
+ width = getSize().width - 1;
+ height = getSize().height - 1;
+
+
+// fillPointlist = new PointList();
+//
+// fillPointlist.addPoint(start, 20);
+// fillPointlist.addPoint(start + 23, 20);
+// fillPointlist.addPoint(start + 23, 0);
+// fillPointlist.addPoint(width - 15, 0);
+// fillPointlist.addPoint(width - 1, 14);
+// fillPointlist.addPoint(width - 1, height - 1);
+// fillPointlist.addPoint(start, height - 1);
+//
+//
+//
+// shadowPointlist = new PointList();
+//
+// shadowPointlist.addPoint(width - 15, 0);
+// shadowPointlist.addPoint(width - 14, 4);
+// shadowPointlist.addPoint(width - 15, 7);
+// shadowPointlist.addPoint(width - 18, 10);
+// shadowPointlist.addPoint(width - 1, 14);
+//
+// shadowPointlist.addPoint(width - 9, 14);
+// shadowPointlist.addPoint(width - 16, 13);
+//
+// shadowPointlist.addPoint(width - 21, 11);
+// shadowPointlist.addPoint(width - 18, 8);
+// shadowPointlist.addPoint(width - 16, 4);
+//
+// shadow2Pointlist = new PointList();
+//
+// shadow2Pointlist.addPoint(width - 15, 0);
+// shadow2Pointlist.addPoint(width - 1, 14);
+// shadow2Pointlist.addPoint(width - 3, 14);
+// shadow2Pointlist.addPoint(width - 15, 2);
+ }
+
+ /**
+ * @see org.eclipse.draw2d.Figure#paintFigure(Graphics)
+ */
+ protected void paintFigure(Graphics g) {
+ Rectangle r = getBounds().getCopy();
+ g.translate(r.getLocation());
+
+ int height = r.height - 1;
+ int start = 0;
+
+
+ g.setBackgroundColor(whiteColor);
+
+ g.fillRectangle(start + 1, 1, 22, 190); // fill left part
+
+ // drawIcon
+ if (icon != null)
+ g.drawImage(icon, start + getInsetX(), getInsetY());
+
+
+ //color the page
+ if (page != null /*&& group.isConfirmed()*/) {
+ g.setBackgroundColor(new Color(null, 0xff, 0xff, 0xc2));
+ } else {
+ g.setBackgroundColor(lightGrayColor);
+ }
+
+ Rectangle boundingRect = new Rectangle(22, 1, r.width, r.height);
+ if(g instanceof ScaledGraphics) {
+ // scaled graphcis does not support gradients ;(
+ g.fillRectangle(boundingRect);
+ } else {
+ Display display = Display.getCurrent();
+
+
+ Point topLeft = boundingRect.getTopLeft();
+ Point bottomRight = boundingRect.getBottomRight();
+
+ Pattern pattern = new Pattern(display, topLeft.x, topLeft.y,
+ bottomRight.x, bottomRight.y,
+ ColorConstants.white, g.getBackgroundColor());
+ g.setBackgroundPattern(pattern);
+ g.fillRectangle(boundingRect);
+ g.setBackgroundPattern(null);
+ pattern.dispose();
+ }
+
+ if(page.getChildren().size() != 0){
+ if(page.isParamsVisible()){
+ g.setForegroundColor(blackColor);
+ g.drawLine(4, height-13, 11, height-13);
+ g.drawLine(4, height-13, 4, height-6);
+
+ g.drawLine(6, height-9, 10, height-9);
+
+ g.setForegroundColor(button2Color);
+ g.drawLine(12, height-13, 12, height-5);
+ g.drawLine(4, height-5, 12, height-5);
+
+ g.setForegroundColor(button3Color);
+ g.setBackgroundColor(button3Color);
+ g.drawLine(5, height-4, 13, height-4);
+ g.drawLine(13, height-4, 13, height-12);
+ g.fillRectangle(6, height-11, 5, 2);
+ g.fillRectangle(6, height-8, 5, 2);
+
+ g.setForegroundColor(button4Color);
+ g.drawLine(5, height-7, 5, height-12);
+ g.drawLine(5, height-12, 10, height-12);
+ }else{
+
+ g.setForegroundColor(button2Color);
+ g.drawLine(4, height-13, 11, height-13);
+ g.drawLine(4, height-13, 4, height-6);
+
+ g.setForegroundColor(blackColor);
+
+ g.drawLine(6, height-9, 10, height-9);
+ g.drawLine(8, height-11, 8, height-7);
+
+ g.drawLine(12, height-13, 12, height-5);
+ g.drawLine(4, height-5, 12, height-5);
+
+ g.setForegroundColor(button3Color);
+ g.drawLine(5, height-4, 13, height-4);
+ g.drawLine(13, height-4, 13, height-12);
+
+ g.drawLine(6, height-6, 11, height-6);
+ g.drawLine(11, height-6, 11, height-12);
+
+ g.setForegroundColor(whiteColor);
+ g.drawLine(5, height-6, 5, height-12);
+ g.drawLine(5, height-12, 11, height-12);
+ }
+ }
+ }
+
+ /** distance from e.g. icon to border Y-axis*/
+ private int getInsetY() {
+ return 2;
+ }
+
+ /** distance from e.g. icon to border X-axis*/
+ private int getInsetX() {
+ return 4;
+ }
+
+ /** the one drawing the "bend corner rectangle" **/
+ class GroupBorder extends LineBorder {
+ public GroupBorder(Color color) {
+ super(color);
+ }
+
+ public void paint(IFigure figure, Graphics graphics, Insets insets) {
+ Rectangle r = getPaintRectangle(figure, insets).getCopy();
+ graphics.translate(r.getLocation());
+ int width = r.width - 1;
+ int height = r.height - 1;
+
+ if (page != null /*&& group.isConfirmed()*/)
+ graphics.setForegroundColor(blackColor);
+ else
+ graphics.setForegroundColor(darkGrayColor);
+
+ graphics.drawLine(1, 0, width-1, 0);
+ graphics.drawLine(0, 1, 0, height - 1);
+ graphics.drawLine(1, height, width-1, height);
+ graphics.drawLine(width, 1, width, height - 1);
+ graphics.drawLine(23 , 0, 23, height);
+
+ /*graphics.drawLine(1, 0, width - 15, 0);
+ graphics.drawLine(0, 1, 0, height - 2);
+ graphics.drawLine(1, height - 1, width - 2, height - 1);
+ graphics.drawLine(width - 1, 14, width - 1, height - 2);
+ graphics.drawLine(width - 15, 0, width - 1, 14);
+
+ graphics.drawLine(0, 1, 1, 0);
+ graphics.drawLine(0, height - 2, 1, height - 1);
+ graphics.drawLine(width - 2, height - 1, width - 1, height - 2);
+
+ graphics.drawLine(width - 15, 0, width - 14, 4);
+ graphics.drawLine(width - 14, 4, width - 15, 7);
+ graphics.drawLine(width - 15, 7, width - 18, 10);
+
+ graphics.drawLine(width - 18, 10, width - 1, 14);*/
+
+ /*graphics.drawLine(23, 0, 23, 19);
+ graphics.drawLine(0, 20, 22, 20);
+ graphics.drawLine(22, 20, 23, 19);*/
+ }
+
+ public void mouseDoubleClicked(MouseEvent me) {
+ }
+
+ public void mousePressed(MouseEvent me) {
+ if (me.button == 3) {
+ ((GEFGraphicalViewer) editPart.getViewer()).setNoDeselect();
+ editPart.getViewer().select(editPart);
+ }
+ }
+
+
+}
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java 2008-06-06
12:36:20 UTC (rev 8608)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java 2008-06-06
13:23:22 UTC (rev 8609)
@@ -112,7 +112,7 @@
g.drawImage(icon, 4, 2);
if(exc != null){
- g.setFont(exceptionFont);
+ g.setFont(nodeLabelFont);
if(exc.getName() != null)
g.drawString(exc.getName(), 27, 3);
else