Author: bfitzpat
Date: 2012-01-26 15:15:42 -0500 (Thu, 26 Jan 2012)
New Revision: 38219
Added:
workspace/bfitzpat/org.jboss.tools.esb.visualizer/icons/refresh.gif
Modified:
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/ESBDomParser.java
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/ESBVisualizerView.java
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/TreeObject.java
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/TreeParent.java
Log:
[JBIDE-10726] Added refresh action, changed "fixed" node indicator to a border
color and size change instead of background color, added copyright headers
Added: workspace/bfitzpat/org.jboss.tools.esb.visualizer/icons/refresh.gif
===================================================================
(Binary files differ)
Property changes on: workspace/bfitzpat/org.jboss.tools.esb.visualizer/icons/refresh.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified:
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/ESBDomParser.java
===================================================================
---
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/ESBDomParser.java 2012-01-26
19:52:06 UTC (rev 38218)
+++
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/ESBDomParser.java 2012-01-26
20:15:42 UTC (rev 38219)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.visualizer.views;
import java.io.File;
Modified:
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/ESBVisualizerView.java
===================================================================
---
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/ESBVisualizerView.java 2012-01-26
19:52:06 UTC (rev 38218)
+++
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/ESBVisualizerView.java 2012-01-26
20:15:42 UTC (rev 38219)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.visualizer.views;
import java.util.Iterator;
@@ -62,13 +72,18 @@
public static final String ID =
"org.jboss.tools.esb.visualizer.views.ESBVisualizerView";
private GraphViewer gv;
+
+ // Some stashed colors
+ private Color defaultBorder;
+
+ // menu items
private Action openESBFileAction;
- private Color defaultBackground;
-
+
// toolbar buttons for different layouts
private IAction horizontalLayoutAction;
private IAction verticalLayoutAction;
private IAction radialLayoutAction;
+ private Action refreshLayoutAction;
// the listener we register with the selection service
private ISelectionListener listener = new ISelectionListener() {
@@ -140,7 +155,7 @@
root.setEsbObjectType(ESBType.ESB);
GraphNode rootnode = new GraphNode(gv.getGraphControl(), ZestStyles.NODES_CACHE_LABEL,
root.getName());
rootnode.setImage(getImageFromPlugin("/icons/esb/esb_file.gif"));
- this.defaultBackground = rootnode.getBackgroundColor();
+ this.defaultBorder = rootnode.getBorderColor();
rootnode.setData(root);
drawNodes(rootnode, root);
drawRefs(rootnode);
@@ -298,6 +313,20 @@
* Make the few actions we have
*/
private void makeActions() {
+
+ refreshLayoutAction = new Action() {
+ @Override
+ public void run() {
+ if (gv != null && gv.getGraphControl().getLayoutAlgorithm() != null) {
+ gv.setLayoutAlgorithm(gv.getGraphControl().getLayoutAlgorithm(), true);
+ }
+ }
+ };
+
+ refreshLayoutAction.setText("Refresh Layout");
+ refreshLayoutAction.setToolTipText("Refresh Layout");
+ refreshLayoutAction.setImageDescriptor(Activator.getImageDescriptor("/icons/refresh.gif"));
+
openESBFileAction = new Action() {
public void run() {
@@ -353,9 +382,12 @@
bars.getMenuManager().add(openESBFileAction);
IToolBarManager toolbar = bars.getToolBarManager();
+
+ toolbar.add(refreshLayoutAction);
horizontalLayoutAction = new LayoutAction(gv, new
HorizontalTreeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING));
horizontalLayoutAction.setImageDescriptor(Activator.getImageDescriptor("/icons/horizontalTreeLayout.gif"));
+ horizontalLayoutAction.setToolTipText("Use Horizontal Tree Layout");
horizontalLayoutAction.addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
@@ -376,6 +408,7 @@
verticalLayoutAction = new LayoutAction(gv, new
TreeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING));
verticalLayoutAction.setImageDescriptor(Activator.getImageDescriptor("/icons/verticalTreeLayout.gif"));
+ verticalLayoutAction.setToolTipText("Use Vertical Tree Layout");
verticalLayoutAction.addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
@@ -396,6 +429,7 @@
radialLayoutAction = new LayoutAction(gv, new
RadialLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING));
radialLayoutAction.setImageDescriptor(Activator.getImageDescriptor("/icons/radialLayout.gif"));
+ radialLayoutAction.setToolTipText("Use Radial Layout");
radialLayoutAction.addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
@@ -460,10 +494,12 @@
TreeObject to = (TreeObject)node.getData();
to.setWasMoved(!to.wasMoved());
if (to.wasMoved()) {
- node.setBackgroundColor(gv.getGraphControl().getDisplay().getSystemColor(
- SWT.COLOR_GREEN));
+ node.setBorderWidth(3);
+ node.setBorderColor(gv.getGraphControl().getDisplay().getSystemColor(
+ SWT.COLOR_BLUE));
} else {
- node.setBackgroundColor(defaultBackground);
+ node.setBorderWidth(1);
+ node.setBorderColor(defaultBorder);
}
}
}
@@ -495,7 +531,9 @@
if (temp == layouts.length)
temp = 0;
currentLayout = temp;
- gv.setLayoutAlgorithm(layouts[currentLayout], true);
+ if (gv.getGraphControl().getLayoutAlgorithm() == null ||
+ !gv.getGraphControl().getLayoutAlgorithm().equals(layouts[currentLayout]))
+ gv.setLayoutAlgorithm(layouts[currentLayout], true);
}
}
Modified:
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/TreeObject.java
===================================================================
---
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/TreeObject.java 2012-01-26
19:52:06 UTC (rev 38218)
+++
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/TreeObject.java 2012-01-26
20:15:42 UTC (rev 38219)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.visualizer.views;
import org.eclipse.core.runtime.IAdaptable;
Modified:
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/TreeParent.java
===================================================================
---
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/TreeParent.java 2012-01-26
19:52:06 UTC (rev 38218)
+++
workspace/bfitzpat/org.jboss.tools.esb.visualizer/src/org/jboss/tools/esb/visualizer/views/TreeParent.java 2012-01-26
20:15:42 UTC (rev 38219)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.visualizer.views;
import java.util.ArrayList;