Author: dazarov
Date: 2008-09-26 11:21:58 -0400 (Fri, 26 Sep 2008)
New Revision: 10514
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PathLabel.java
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/figures/FigureFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2254
fine tuning
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-26
15:20:23 UTC (rev 10513)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-09-26
15:21:58 UTC (rev 10514)
@@ -35,7 +35,6 @@
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.gef.edit.GEFRootEditPart;
-import org.jboss.tools.common.gef.figures.GEFLabel;
import org.jboss.tools.common.gef.figures.xpl.CustomLocator;
import org.jboss.tools.seam.ui.pages.editor.PagesEditor;
import org.jboss.tools.seam.ui.pages.editor.PagesEditor.ModelSelectionProvider;
@@ -44,6 +43,7 @@
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesElement;
import org.jboss.tools.seam.ui.pages.editor.figures.ConnectionFigure;
import org.jboss.tools.seam.ui.pages.editor.figures.FigureFactory;
+import org.jboss.tools.seam.ui.pages.editor.figures.PathLabel;
public class LinkEditPart extends AbstractConnectionEditPart implements
PropertyChangeListener, EditPartListener {
@@ -60,11 +60,11 @@
private CustomLocator shortcutLocator;
- private GEFLabel shortcutLabel;
+ private PathLabel shortcutLabel;
private CustomLocator pathLocator;
- private GEFLabel pathLabel;
+ private PathLabel pathLabel;
private PageEditPart pagePart = null;
@@ -118,8 +118,7 @@
//conn.repaint();
}
- pathLabel = new GEFLabel(getLink().getName(),
- FigureFactory.normalColor);
+ pathLabel = new PathLabel(getLink().getName());
pathLabel.setFont(pathFont);
pathLabel.setIcon(null);
pathLabel.setTextAlignment(Label.LEFT);
@@ -136,7 +135,7 @@
if(getLink().getToElement() != null)
text = getLink().getToElement().getName();
- shortcutLabel = new GEFLabel(text, FigureFactory.normalColor);
+ shortcutLabel = new PathLabel(text);
// if (getLink().getJSFModel().getOptions().showShortcutIcon())
shortcutLabel.setIcon(icon);
// shortcutLabel.setFont(getLink().getJSFModel().getOptions()
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-26
15:20:23 UTC (rev 10513)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/FigureFactory.java 2008-09-26
15:21:58 UTC (rev 10514)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.seam.ui.pages.editor.figures;
-import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.PolygonDecoration;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.swt.graphics.Color;
@@ -19,9 +18,9 @@
import org.jboss.tools.seam.ui.pages.editor.edit.xpl.PagesConnectionRouter;
public class FigureFactory {
- public static final Color normalColor = new Color(null, 0x88, 0x89, 0x88);
+ public static final Color pathColor = new Color(null, 0x84, 0x85, 0x84);
+ public static final Color normalColor = new Color(null, 0xad, 0xae, 0xad);
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();
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PathLabel.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PathLabel.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PathLabel.java 2008-09-26
15:21:58 UTC (rev 10514)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.draw2d.Graphics;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+public class PathLabel extends Label{
+
+ public PathLabel(String name){
+ super(name);
+ }
+
+ protected void paintFigure(Graphics graphics){
+ Rectangle bounds = getBounds();
+ graphics.translate(bounds.x, bounds.y);
+ if(!graphics.getForegroundColor().equals(FigureFactory.selectedColor))
graphics.setForegroundColor(FigureFactory.pathColor);
+ if(getIcon()!= null)graphics.drawImage(getIcon(), getIconLocation());
+ graphics.drawText(getSubStringText(), getTextLocation());
+ graphics.translate(-bounds.x, -bounds.y);
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PathLabel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain