Author: dazarov
Date: 2008-09-25 08:37:33 -0400 (Thu, 25 Sep 2008)
New Revision: 10476
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_exception.png
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_minus.png
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_page.png
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_plus.png
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEndpointEditPolicy.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesXYLayoutEditPolicy.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFeedbackFigure.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/FigureFactory.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
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2254
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_exception.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_exception.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_minus.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_minus.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_page.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_page.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_plus.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/ico_plus.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -133,7 +133,9 @@
String text = "";
// if (getLink().getJSFModel().getOptions().showShortcutPath())
+ if(getLink().getToElement() != null)
text = getLink().getToElement().getName();
+
shortcutLabel = new GEFLabel(text, FigureFactory.normalColor);
// if (getLink().getJSFModel().getOptions().showShortcutIcon())
shortcutLabel.setIcon(icon);
@@ -251,9 +253,10 @@
public void linkChange(Link source) {
pathLabel.setText(getLink().getName());
// if (getLinkModel().getJSFModel().getOptions().showShortcutPath())
+ if(getLink().getToElement() != null)
shortcutLabel.setText(getLink().getToElement().getName());
-// else
-// shortcutLabel.setText("");
+ else
+ shortcutLabel.setText("");
// if (getLinkModel().getJSFModel().getOptions().showShortcutIcon())
shortcutLabel.setIcon(icon);
// else
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEndpointEditPolicy.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEndpointEditPolicy.java 2008-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEndpointEditPolicy.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -26,7 +26,6 @@
import org.eclipse.gef.handles.AbstractHandle;
import org.eclipse.gef.handles.ConnectionHandle;
import org.eclipse.gef.tools.ConnectionEndpointTracker;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.events.MouseEvent;
import org.jboss.tools.jst.web.model.ReferenceObject;
@@ -34,6 +33,7 @@
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
import org.jboss.tools.seam.ui.pages.editor.figures.ConnectionFigure;
+import org.jboss.tools.seam.ui.pages.editor.figures.FigureFactory;
public class LinkEndpointEditPolicy
@@ -70,7 +70,7 @@
super.addSelectionHandles();
addPagesHandles();
- getConnectionFigure().setSelected(true);
+ getConnectionFigure().setForegroundColor(FigureFactory.selectedColor);
}
protected ConnectionFigure getConnectionFigure() {
@@ -80,7 +80,7 @@
protected void removeSelectionHandles() {
super.removeSelectionHandles();
removePagesHandles();
- getConnectionFigure().setSelected(false);
+ getConnectionFigure().setForegroundColor(FigureFactory.normalColor);
}
protected List createSelectionHandles() {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesXYLayoutEditPolicy.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesXYLayoutEditPolicy.java 2008-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesXYLayoutEditPolicy.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.RectangleFigure;
@@ -115,7 +116,7 @@
((RectangleFigure) figure).setXOR(true);
((RectangleFigure) figure).setFill(true);
figure.setBackgroundColor(NodeFigure.ghostFillColor);
- figure.setForegroundColor(NodeFigure.whiteColor);
+ figure.setForegroundColor(ColorConstants.white);
}
return figure;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java 2008-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -18,7 +18,6 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.swt.SWT;
-import org.jboss.tools.jst.web.model.ReferenceObject;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
import org.jboss.tools.seam.ui.pages.editor.edit.LinkEditPart;
@@ -87,15 +86,7 @@
editPart.clear();
}
- private boolean selected;
-
protected void outlineShape(Graphics g) {
- if(selected) {
- g.setForegroundColor(FigureFactory.selectedColor);
- } else {
- g.setForegroundColor(getForegroundColor());
- }
-
Page page=null;
if(link != null && link.getFromElement() instanceof Page)
page = (Page)link.getFromElement();
@@ -197,10 +188,6 @@
beg.y = point.y;
}
}
- public void setSelected(boolean selected) {
- this.selected = selected;
- repaint();
- }
public void layout() {
if(getParent() != null)
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFeedbackFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFeedbackFigure.java 2008-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFeedbackFigure.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.ui.pages.editor.figures;
+import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Rectangle;
@@ -24,7 +25,7 @@
protected void paintFigure(Graphics g) {
g.setXORMode(true);
- g.setForegroundColor(whiteColor);
+ g.setForegroundColor(ColorConstants.white);
g.setBackgroundColor(ghostFillColor);
Rectangle r = getBounds().getCopy();
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-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.ui.pages.editor.figures;
+import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LineBorder;
@@ -19,19 +20,30 @@
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.handles.HandleBounds;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.gef.GEFGraphicalViewer;
+import org.jboss.tools.seam.ui.pages.editor.PagesEditor;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PageException;
import org.jboss.tools.seam.ui.pages.editor.edit.ExceptionEditPart;
import org.jboss.tools.seam.ui.pages.editor.figures.xpl.CompressNameUtil;
import org.jboss.tools.seam.ui.pages.editor.figures.xpl.FixedConnectionAnchor;
-import org.jboss.tools.seam.ui.pages.editor.print.PrintIconHelper;
public class ExceptionFigure extends NodeFigure implements HandleBounds {
private static final Dimension SIZE = new Dimension(56, 100);
+
+ private static final Color exceptionBackgroundColor = new Color(null, 0xea, 0xf3,
0xff);
+
+ private static final Color exceptionForegroundColor = new Color(null, 0x41, 0x77,
0xa0);
+
+ private static final Color borderColor = new Color(null, 0x67, 0x7f, 0x91);
+
+ private static final Color greyForeground = new Color(null, 0x99, 0x95, 0x99);
+
+ private static final Image exceptionImage = ImageDescriptor.createFromFile(
+ PagesEditor.class, "icons/ico_exception.png").createImage();
- private Image icon = null;
public PageException exc;
@@ -46,28 +58,18 @@
}
public void setIcon(Image i) {
- icon = PrintIconHelper.getPrintImage(i);
}
public ExceptionFigure(PageException group) {
this.exc = group;
- if (group != null && group.getData() != null) {
- setIcon(group.getImage());
- }
-
setOpaque(false);
setLayoutManager(new XYLayout());
- setBorder(new GroupBorder(blackColor));
+ setBorder(new GroupBorder(ColorConstants.black));
if (group != null) {
FixedConnectionAnchor c;
- c = new FixedConnectionAnchor(this);
- c.offsetV = 10;
- //c.offsetH = -1;
- connectionAnchors.put("1_IN", c);
- inputConnectionAnchors.addElement(c);
c = new FixedConnectionAnchor(this);
c.offsetV = 10;
@@ -108,18 +110,15 @@
g.setBackgroundColor(lightGrayColor);
}
- g.fillRectangle(1, 1, r.width-2, r.height-2);
-
- g.setBackgroundColor(whiteColor);
-
- g.fillRectangle(1, 1, 22, 19);
-
- if (icon != null)
- g.drawImage(icon, 4, 2);
+ Rectangle boundingRect = new Rectangle(1, 1, r.width, r.height);
+ g.fillRectangle(boundingRect);
+
+ g.drawImage(exceptionImage, 1, 1);
+
if(exc != null){
g.setFont(nodeLabelFont);
- g.drawString(getExceptionReadOnlyLabel(), 27, 3);
+ g.drawString(getExceptionReadOnlyLabel(), 27, 1);
}
@@ -149,17 +148,14 @@
int height = r.height - 1;
if (exc != null)
- graphics.setForegroundColor(blackColor);
+ graphics.setForegroundColor(borderColor);
else
- graphics.setForegroundColor(darkGrayColor);
-
+ graphics.setForegroundColor(greyForeground);
+
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);
-
-
}
public void mouseDoubleClicked(MouseEvent me) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/FigureFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/FigureFactory.java 2008-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/FigureFactory.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -11,44 +11,37 @@
package org.jboss.tools.seam.ui.pages.editor.figures;
import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ManhattanConnectionRouter;
import org.eclipse.draw2d.PolygonDecoration;
import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.jdt.internal.ui.preferences.formatter.BlankLinesTabPage;
import org.eclipse.swt.graphics.Color;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.edit.LinkEditPart;
import org.jboss.tools.seam.ui.pages.editor.edit.xpl.PagesConnectionRouter;
public class FigureFactory {
- public static final Color normalColor = new Color(null, 0xb5, 0xb5, 0xb5);
- public static final Color selectedColor = new Color(null, 0x44, 0xa9, 0xf3);
+ public static final Color normalColor = new Color(null, 0x88, 0x89, 0x88);
+ public static final Color selectedColor = new Color(null, 0xff, 0x84, 0x00);
public static final Color highlightColor = ColorConstants.black;
public static final PointList TRIANGLE_TIP = new PointList();
static {
- TRIANGLE_TIP.addPoint(0, 0);
- TRIANGLE_TIP.addPoint(-1, -1);
- TRIANGLE_TIP.addPoint(-7, -4);
- TRIANGLE_TIP.addPoint(-8, -4);
- TRIANGLE_TIP.addPoint(-8, 4);
- TRIANGLE_TIP.addPoint(0, 0);
+ TRIANGLE_TIP.addPoint(0, -3);
+ TRIANGLE_TIP.addPoint(7, 0);
+ TRIANGLE_TIP.addPoint(0, 3);
}
public static ConnectionFigure createNewBendableWire(LinkEditPart part,
Link link) {
ConnectionFigure conn = new ConnectionFigure(part);
- conn.setForegroundColor(NodeFigure.blackColor);
+ conn.setForegroundColor(normalColor);
PolygonDecoration decor = new PolygonDecoration();
- decor.setBackgroundColor(NodeFigure.blackColor);
decor.setTemplate(TRIANGLE_TIP);
decor.setScale(1, 1);
- decor.setForegroundColor(NodeFigure.blackColor);
conn.setTargetDecoration(decor);
-
+ decor.setFill(false);
return conn;
}
@@ -59,7 +52,6 @@
conn.setForegroundColor(selectedColor);
PolygonDecoration decor = new PolygonDecoration();
- decor.setBackgroundColor(NodeFigure.whiteColor);
decor.setTemplate(TRIANGLE_TIP);
decor.setScale(1, 1);
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-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -22,54 +22,13 @@
public class NodeFigure extends
BaseNodeFigure {
- public static final Color blackColor = new Color(null, 0x00, 0x00, 0x00);
-
- public static final Color whiteColor = new Color(null, 0xff, 0xff, 0xff);
-
- public static final Color orangeColor = new Color(null, 0xff, 0xea, 0x82);
-
- public static final Color yellowColor = new Color(null, 0xff, 0xf6, 0xcb);
-
- public static final Color brownColor = new Color(null, 0xf0, 0xe8, 0xbf);
-
- public static final Color lightGrayColor = new Color(null, 0xf1, 0xf1, 0xf1);
-
- public static final Color darkGrayColor = new Color(null, 0xb3, 0xb3, 0xb3);
-
- public static final Color lightBlueColor = new Color(null, 0xd4, 0xe6, 0xff);
-
- public static final Color darkBlueColor = new Color(null, 0x97, 0xc4, 0xff);
-
- public static final Color pattSelected = new Color(null, 0xc6, 0xda, 0xe8);
-
- public static final Color pattBorder = new Color(null, 0x3e, 0x75, 0x99);
-
- public static final Color errorColor = new Color(null, 0xff, 0xb9, 0xb9);
-
- public static final Color errorSelected = new Color(null, 0xff, 0xa2, 0xa2);
-
- public static final Color errorBorder = new Color(null, 0xc5, 0x63, 0x62);
-
- public static final Color selectedColor = new Color(null, 0xf0, 0xe8, 0xbf);
-
- public static final Color borderColor = new Color(null, 0x86, 0x7d, 0x51);
-
+
public final static Color ghostFillColor = new Color(null, 31, 31, 31);
- public static final Color exceptionBackgroundColor = new Color(null, 0xff, 0xe3, 0xe7);
-
- public static final Color exceptionForegroundColor = blackColor; //new Color(null, 0x99,
0x07, 0x02);
-
- public static final Color button1Color = new Color(null, 0xff, 0xf6, 0xc8);
- public static final Color button2Color = new Color(null, 0x98, 0x99, 0x98);
- 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 nodeLabelFont = new Font(null, "default", 10,
SWT.BOLD); // TODO: use preference font mechanism for this
- public static final Font nameParamFont = new Font(null, "default", 10,
SWT.BOLD); // TODO: use preference font mechanism for this
- public static final Font valueParamFont = new Font(null, "default", 10,
SWT.NORMAL); // TODO: use preference font mechanism for this
-
+ public static final Color lightGrayColor = new Color(null, 0xf1, 0xf1, 0xf1);
+
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-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFeedbackFigure.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.ui.pages.editor.figures;
+import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Rectangle;
@@ -24,7 +25,7 @@
protected void paintFigure(Graphics g) {
g.setXORMode(true);
- g.setForegroundColor(whiteColor);
+ g.setForegroundColor(ColorConstants.white);
g.setBackgroundColor(ghostFillColor);
Rectangle r = getBounds().getCopy();
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-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.ui.pages.editor.figures;
+import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
@@ -19,21 +20,36 @@
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.handles.HandleBounds;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.jst.web.model.ReferenceObject;
import org.jboss.tools.seam.pages.xml.model.helpers.SeamPagesDiagramStructureHelper;
+import org.jboss.tools.seam.ui.pages.editor.PagesEditor;
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{
private static final Dimension SIZE = new Dimension(56, 100);
+
+ private static final Color backgroundColor = new Color(null, 0xff, 0xf7, 0xcb);
+
+ private static final Color foregroundColor = new Color(null, 0x9d, 0x96, 0x24);
+
+ private static final Color greyBackground = new Color(null, 0xf1, 0xf1, 0xf1);
+
+ private static final Color greyForeground = new Color(null, 0x99, 0x95, 0x99);
+
+ private static final Image pageImage = ImageDescriptor.createFromFile(
+ PagesEditor.class, "icons/ico_page.png").createImage();
+
+ private static final Image plusImage = ImageDescriptor.createFromFile(
+ PagesEditor.class, "icons/ico_plus.png").createImage();
- private Image icon = null;
+ private static final Image minusImage = ImageDescriptor.createFromFile(
+ PagesEditor.class, "icons/ico_minus.png").createImage();
public Page page;
@@ -50,7 +66,7 @@
}
public void setIcon(Image i) {
- icon = PrintIconHelper.getPrintImage(i);
+ //icon = PrintIconHelper.getPrintImage(i);
}
@@ -65,13 +81,13 @@
setOpaque(false);
setLayoutManager(new XYLayout());
- setBorder(new PageBorder(blackColor));
+ setBorder(new PageBorder(ColorConstants.black));
if (page != null) {
FixedConnectionAnchor c;
c = new FixedConnectionAnchor(this);
c.offsetV = 10;
- c.offsetH = -1;
+ c.offsetH = -8;
connectionAnchors.put("1_IN", c);
inputConnectionAnchors.addElement(c);
@@ -110,50 +126,30 @@
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());
-
- if(page != null && page.getData() != null &&
SeamPagesDiagramStructureHelper.instance.isUnconfirmedPage((XModelObject)page.getData())){
- g.drawImage(errorIcon, start + getInsetX(), getInsetY()+8);
- }
-
- //color the page
if (page != null) {
- g.setBackgroundColor(new Color(null, 0xff, 0xff, 0xc2));
- } else {
- g.setBackgroundColor(lightGrayColor);
+ if(page.isConfirmed()){
+ g.setBackgroundColor(backgroundColor);
+ g.setForegroundColor(foregroundColor);
+ }else{
+ g.setBackgroundColor(greyBackground);
+ g.setForegroundColor(greyForeground);
+ }
+ } else{
+ g.setBackgroundColor(greyBackground);
+ g.setForegroundColor(greyForeground);
}
- Rectangle boundingRect = new Rectangle(22, 1, r.width, r.height);
+ Rectangle boundingRect = new Rectangle(1, 1, r.width, r.height);
g.fillRectangle(boundingRect);
+
+ // drawIcon
+ g.drawImage(pageImage, 1, 1);
-// 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 != null && page.getData() != null &&
SeamPagesDiagramStructureHelper.instance.isUnconfirmedPage((XModelObject)page.getData())){
+ g.drawImage(errorIcon, getInsetX(), getInsetY()+8);
+ }
if(page != null && page.getName() != null){
g.setFont(nodeLabelFont);
@@ -162,50 +158,9 @@
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);
+ g.drawImage(minusImage, 4, 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);
+ g.drawImage(plusImage, 4, height-12);
}
}
}
@@ -239,19 +194,14 @@
}
if (page != null)
- graphics.setForegroundColor(blackColor);
+ graphics.setForegroundColor(foregroundColor);
else
- graphics.setForegroundColor(darkGrayColor);
+ graphics.setForegroundColor(greyForeground);
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);
+ }
}
-
-
-
-
-}
}
\ 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-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -17,12 +17,18 @@
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.handles.HandleBounds;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Param;
import org.jboss.tools.seam.ui.pages.editor.edit.ParamEditPart;
public class ParamFigure extends NodeFigure implements HandleBounds {
private static final Dimension SIZE = new Dimension(56, 100);
+
+ private static final Font nameParamFont = new Font(null, "default", 10,
SWT.BOLD); // TODO: use preference font mechanism for this
+ private static final Font valueParamFont = new Font(null, "default", 10,
SWT.NORMAL); // TODO: use preference font mechanism for this
+
public Param param;
ParamEditPart editPart;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java 2008-09-25
10:06:19 UTC (rev 10475)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java 2008-09-25
12:37:33 UTC (rev 10476)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.ui.pages.editor.figures;
+import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LineBorder;
@@ -23,6 +24,8 @@
public class ParamListFigure extends NodeFigure implements HandleBounds {
private static final Dimension SIZE = new Dimension(56, 100);
+
+ private static final Color darkGrayColor = new Color(null, 0xb3, 0xb3, 0xb3);
public PageWrapper paramList;
@@ -42,7 +45,7 @@
setOpaque(false);
setLayoutManager(new ParamListLayout());
- setBorder(new GroupBorder(blackColor));
+ setBorder(new GroupBorder(ColorConstants.black));
}
/**