Author: kono
Date: 2010-07-15 16:57:52 -0700 (Thu, 15 Jul 2010)
New Revision: 20943
Modified:
cytoscape/trunk/src/cytoscape/visual/ui/DefaultAppearenceBuilder.java
cytoscape/trunk/src/cytoscape/visual/ui/NestedNetworkMenuListener.java
cytoscape/trunk/src/cytoscape/visual/ui/ValueSelectDialog.java
cytoscape/trunk/src/cytoscape/visual/ui/VizMapperMainPanel.java
cytoscape/trunk/src/cytoscape/visual/ui/VizMapperProperty.java
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/C2CMappingEditor.java
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/DiscreteTrackRenderer.java
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/EditorValueRangeTracer.java
cytoscape/trunk/src/cytoscape/visual/ui/editors/discrete/CyComboBoxPropertyEditor.java
Log:
Bug ID 0002264: "Custom Graphics selector list should be optimized" is fixed.
Now GUI sets correct height for Graphics cells.
Modified: cytoscape/trunk/src/cytoscape/visual/ui/DefaultAppearenceBuilder.java
===================================================================
--- cytoscape/trunk/src/cytoscape/visual/ui/DefaultAppearenceBuilder.java
2010-07-15 23:23:07 UTC (rev 20942)
+++ cytoscape/trunk/src/cytoscape/visual/ui/DefaultAppearenceBuilder.java
2010-07-15 23:57:52 UTC (rev 20943)
@@ -104,14 +104,18 @@
*/
public class DefaultAppearenceBuilder extends JDialog {
- private static final Dimension PANEL_SIZE = new Dimension(500, 27);
-
private static final long serialVersionUID = 596165395462496156L;
+ // Default dialog size for Default Appearence Builder.
+ private static final int VIEW_WIDTH = 350;
+ private static final int LIST_WIDTH = 550;
+
+ private static final Dimension DIALOG_SIZE = new Dimension(900, 500);
+
private static final Set<VisualPropertyType> EDGE_PROPS;
private static final Set<VisualPropertyType> NODE_PROPS;
- private static CyLogger logger =
CyLogger.getLogger(DefaultAppearenceBuilder.class);
+ private static final CyLogger logger =
CyLogger.getLogger(DefaultAppearenceBuilder.class);
// This editor should be a singleton.
private static DefaultAppearenceBuilder dab = null;
@@ -127,7 +131,7 @@
* @param parent DOCUMENT ME!
* @param modal DOCUMENT ME!
*/
- public DefaultAppearenceBuilder(Frame parent, boolean modal) {
+ private DefaultAppearenceBuilder(final Frame parent, final boolean
modal) {
super(parent, modal);
initComponents();
buildList();
@@ -139,6 +143,7 @@
});
}
+
/**
* DOCUMENT ME!
*
@@ -146,17 +151,16 @@
*
* @return DOCUMENT ME!
*/
- public static JPanel showDialog(Frame parent) {
+ static JPanel showDialog(Frame parent) {
if (dab == null)
dab = new DefaultAppearenceBuilder(parent, true);
- dab.setLocationRelativeTo(parent);
- dab.setSize(900, 450);
+ dab.setSize(DIALOG_SIZE);
dab.buildList();
dab.mainView.updateView();
- dab.setLocationRelativeTo(Cytoscape.getDesktop());
+ dab.setLocationRelativeTo(parent);
dab.setVisible(true);
return dab.getPanel();
@@ -167,11 +171,10 @@
*
* @return DOCUMENT ME!
*/
- public static JPanel getDefaultView(String vsName) {
+ static final JPanel getDefaultView(String vsName) {
if (dab == null)
dab = new
DefaultAppearenceBuilder(Cytoscape.getDesktop(), true);
- //Cytoscape.getVisualMappingManager().setVisualStyle(vsName);
dab.mainView.updateBackgroungColor(Cytoscape.getVisualMappingManager().getVisualStyle()
.getGlobalAppearanceCalculator()
.getDefaultBackgroundColor());
@@ -231,7 +234,9 @@
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Default Appearance for "
+
Cytoscape.getVisualMappingManager().getVisualStyle().getName());
- mainView.setBorder(new LineBorder(java.awt.Color.darkGray, 1,
true));
+
+ mainView.setPreferredSize(new Dimension(VIEW_WIDTH, 300));
+ mainView.setBorder(new LineBorder(Color.darkGray, 1, true));
org.jdesktop.layout.GroupLayout jXPanel2Layout = new
org.jdesktop.layout.GroupLayout(mainView);
mainView.setLayout(jXPanel2Layout);
@@ -241,9 +246,8 @@
.add(0, 237,
Short.MAX_VALUE));
jXTitledPanel1.setTitle("Default Visual Properties");
- jXTitledPanel1.setTitleFont(new java.awt.Font("SansSerif", 1,
12));
- jXTitledPanel1.setMinimumSize(PANEL_SIZE);
- jXTitledPanel1.setPreferredSize(PANEL_SIZE);
+ jXTitledPanel1.setTitleFont(new Font("SansSerif", Font.BOLD,
12));
+ jXTitledPanel1.setPreferredSize(new Dimension(LIST_WIDTH, 300));
defaultObjectTabbedPane.setTabPlacement(JTabbedPane.BOTTOM);
nodeScrollPane.setViewportView(nodeList);
@@ -276,15 +280,14 @@
Cytoscape.getCurrentNetworkView().redrawGraph(false, true);
dispose();
}
- });
+ });
cancelButton.setText("Cancel");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
dispose();
}
- });
+ });
org.jdesktop.layout.GroupLayout jXPanel1Layout = new
org.jdesktop.layout.GroupLayout(jXPanel1);
jXPanel1.setLayout(jXPanel1Layout);
@@ -304,7 +307,7 @@
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jXTitledPanel1,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
-
350, Short.MAX_VALUE)
+
500, Short.MAX_VALUE)
.add(12, 12, 12)));
jXPanel1Layout.setVerticalGroup(jXPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING,
@@ -326,18 +329,7 @@
.add(cancelButton)
.add(applyButton))))
.addContainerGap()));
-
- org.jdesktop.layout.GroupLayout layout = new
org.jdesktop.layout.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
-
layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(jXPanel1,
-
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
-
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE));
-
layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(jXPanel1,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
-
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE));
+ this.getContentPane().add(jXPanel1);
pack();
} // </editor-fold>
@@ -535,7 +527,10 @@
}
- class VisualPropCellRenderer extends JLabel implements ListCellRenderer
{
+ static class VisualPropCellRenderer extends JLabel implements
ListCellRenderer {
+
+ private static final long serialVersionUID =
-4980971466313937239L;
+
private final Font SELECTED_FONT = new Font("SansSerif",
Font.ITALIC, 14);
private final Font NORMAL_FONT = new Font("SansSerif",
Font.BOLD, 12);
private final Color SELECTED_COLOR = new Color(10, 50, 180, 20);
@@ -590,7 +585,10 @@
/*
* Draw global color icon
*/
- class GlobalIcon extends VisualPropertyIcon {
+ static class GlobalIcon extends VisualPropertyIcon {
+
+ private static final long serialVersionUID =
-2292185584380604923L;
+
public GlobalIcon(String name, Color color) {
super(name, color);
}
Modified: cytoscape/trunk/src/cytoscape/visual/ui/NestedNetworkMenuListener.java
===================================================================
--- cytoscape/trunk/src/cytoscape/visual/ui/NestedNetworkMenuListener.java
2010-07-15 23:23:07 UTC (rev 20942)
+++ cytoscape/trunk/src/cytoscape/visual/ui/NestedNetworkMenuListener.java
2010-07-15 23:57:52 UTC (rev 20943)
@@ -87,8 +87,12 @@
}
- class SetNestedNetworkMenuItemAction extends AbstractAction {
- NodeView nodeView;
+ private static final class SetNestedNetworkMenuItemAction extends
AbstractAction {
+
+ private static final long serialVersionUID =
8460477959913047234L;
+
+ private final NodeView nodeView;
+
public SetNestedNetworkMenuItemAction(NodeView nodeView) {
super("Set Nested Network");
this.nodeView = nodeView;
@@ -102,8 +106,12 @@
}
- class DeleteNestedNetworkMenuItemAction extends AbstractAction {
- NodeView nodeView;
+ static class DeleteNestedNetworkMenuItemAction extends AbstractAction {
+
+ private static final long serialVersionUID =
-1413503506096197791L;
+
+ private final NodeView nodeView;
+
public DeleteNestedNetworkMenuItemAction(NodeView nodeView) {
super("Delete Nested Network");
this.nodeView = nodeView;
@@ -124,8 +132,12 @@
}
- class GotoNestedNetworkMenuItemAction extends AbstractAction {
- NodeView nodeView;
+ private static final class GotoNestedNetworkMenuItemAction extends
AbstractAction {
+
+ private static final long serialVersionUID =
-2090577740180052939L;
+
+ private final NodeView nodeView;
+
public GotoNestedNetworkMenuItemAction(NodeView nodeView) {
super("Go to Nested Network");
this.nodeView = nodeView;
Modified: cytoscape/trunk/src/cytoscape/visual/ui/ValueSelectDialog.java
===================================================================
--- cytoscape/trunk/src/cytoscape/visual/ui/ValueSelectDialog.java
2010-07-15 23:23:07 UTC (rev 20942)
+++ cytoscape/trunk/src/cytoscape/visual/ui/ValueSelectDialog.java
2010-07-15 23:57:52 UTC (rev 20943)
@@ -31,7 +31,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ */
package cytoscape.visual.ui;
import static cytoscape.visual.VisualPropertyType.EDGE_SRCARROW_SHAPE;
@@ -68,79 +68,85 @@
import cytoscape.visual.VisualPropertyType;
import cytoscape.visual.ui.icon.VisualPropertyIcon;
-
/**
* Visual Property selector for discrete values
*
* @author kono
*/
public class ValueSelectDialog extends JDialog {
-
+
private static final long serialVersionUID = 1201804212862509435L;
-
+
// Target visual property.
private final VisualPropertyType type;
-
+
// Map from actual value to its icon.
private Map<Object, Icon> iconMap;
-
+
private List orderedKeyList;
-
+
private Object originalValue;
-
+
private boolean canceled = false;
-
+
private static final int WIDTH = 480;
private final int height;
-
+
private final String listTitle;
-
+
private static final int ICON_CELL_HEIGHT = 140;
/**
* Static method to show dialog and get a value from user.
- *
+ *
* @param type
* @param parent
* @return
*/
- public static Object showDialog(final VisualPropertyType type, final
Window parent) {
-
- final ValueSelectDialog dialog = new ValueSelectDialog(type,
parent, true);
-
+ public static Object showDialog(final VisualPropertyType type,
+ final Window parent) {
+
+ final ValueSelectDialog dialog = new ValueSelectDialog(type,
parent,
+ true);
+
dialog.setLocationRelativeTo(parent);
dialog.setVisible(true);
return dialog.getValue();
}
- private ValueSelectDialog(VisualPropertyType type, Window parent,
boolean modal) {
+ private ValueSelectDialog(VisualPropertyType type, Window parent,
+ boolean modal) {
super(Cytoscape.getDesktop(), modal);
final Toolkit toolkit = this.getToolkit();
final Dimension screenSize = toolkit.getScreenSize();
- height = (int)(screenSize.getHeight() * 0.7);
-
+ height = (int) (screenSize.getHeight() * 0.7);
+
this.type = type;
iconMap = this.type.getVisualProperty().getIconSet();
initComponents();
setList();
-
+
// Special case handling
// TODO: Create more user-friendly GUI only for Custom Graphics.
- if(type.equals(NODE_CUSTOM_GRAPHICS_1)) {
+ if (type.equals(NODE_CUSTOM_GRAPHICS_1)) {
this.iconList.setFixedCellHeight(ICON_CELL_HEIGHT);
this.listTitle = "Custom Graphics";
} else {
this.listTitle = type.getName();
}
-
+
mainPanel.setTitle(listTitle);
-
+
// get original value and set the selected item.
- if ( type.isNodeProp() )
- originalValue =
Cytoscape.getVisualMappingManager().getVisualStyle().getNodeAppearanceCalculator().getDefaultAppearance().get(type);
- else
- originalValue =
Cytoscape.getVisualMappingManager().getVisualStyle().getEdgeAppearanceCalculator().getDefaultAppearance().get(type);
+ if (type.isNodeProp())
+ originalValue = Cytoscape.getVisualMappingManager()
+
.getVisualStyle().getNodeAppearanceCalculator()
+ .getDefaultAppearance().get(type);
+ else
+ originalValue = Cytoscape.getVisualMappingManager()
+
.getVisualStyle().getEdgeAppearanceCalculator()
+ .getDefaultAppearance().get(type);
}
/**
@@ -154,7 +160,7 @@
mainPanel = new org.jdesktop.swingx.JXTitledPanel();
iconListScrollPane = new javax.swing.JScrollPane();
iconList = new JXList(true);
-
+
applyButton = new javax.swing.JButton();
cancelButton = new javax.swing.JButton();
@@ -169,60 +175,68 @@
applyButton.setText("Apply");
applyButton.addActionListener(new
java.awt.event.ActionListener() {
- public void
actionPerformed(java.awt.event.ActionEvent evt) {
- applyButtonActionPerformed(evt);
- }
- });
+ public void actionPerformed(java.awt.event.ActionEvent
evt) {
+ applyButtonActionPerformed(evt);
+ }
+ });
cancelButton.setText("Cancel");
cancelButton.addActionListener(new
java.awt.event.ActionListener() {
- public void
actionPerformed(java.awt.event.ActionEvent evt) {
- cancelButtonActionPerformed(evt);
- }
- });
+ public void actionPerformed(java.awt.event.ActionEvent
evt) {
+ cancelButtonActionPerformed(evt);
+ }
+ });
// Currently not implemented
cancelButton.setVisible(true);
-
- org.jdesktop.layout.GroupLayout mainPanelLayout = new
org.jdesktop.layout.GroupLayout(mainPanel
-
.getContentContainer());
+ org.jdesktop.layout.GroupLayout mainPanelLayout = new
org.jdesktop.layout.GroupLayout(
+ mainPanel.getContentContainer());
mainPanel.getContentContainer().setLayout(mainPanelLayout);
-
mainPanelLayout.setHorizontalGroup(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
-
.add(org.jdesktop.layout.GroupLayout.TRAILING,
-
mainPanelLayout.createSequentialGroup()
-
.addContainerGap(128,
-
Short.MAX_VALUE)
-
.add(cancelButton)
-
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
-
.add(applyButton)
-
.addContainerGap())
-
.add(iconListScrollPane,
-
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- WIDTH,
Short.MAX_VALUE));
-
mainPanelLayout.setVerticalGroup(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
-
.add(org.jdesktop.layout.GroupLayout.TRAILING,
-
mainPanelLayout.createSequentialGroup()
-
.add(iconListScrollPane,
-
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
-
height,
-
Short.MAX_VALUE)
-
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
-
.add(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
-
.add(applyButton)
-
.add(cancelButton))
-
.addContainerGap()));
+ mainPanelLayout
+ .setHorizontalGroup(mainPanelLayout
+ .createParallelGroup(
+
org.jdesktop.layout.GroupLayout.LEADING)
+
.add(org.jdesktop.layout.GroupLayout.TRAILING,
+ mainPanelLayout
+
.createSequentialGroup()
+
.addContainerGap(128, Short.MAX_VALUE)
+
.add(cancelButton)
+
.addPreferredGap(
+
org.jdesktop.layout.LayoutStyle.RELATED)
+
.add(applyButton).addContainerGap())
+ .add(iconListScrollPane,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ WIDTH,
Short.MAX_VALUE));
+ mainPanelLayout
+ .setVerticalGroup(mainPanelLayout
+ .createParallelGroup(
+
org.jdesktop.layout.GroupLayout.LEADING)
+
.add(org.jdesktop.layout.GroupLayout.TRAILING,
+ mainPanelLayout
+
.createSequentialGroup()
+
.add(iconListScrollPane,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+
height, Short.MAX_VALUE)
+
.addPreferredGap(
+
org.jdesktop.layout.LayoutStyle.RELATED)
+
.add(mainPanelLayout
+
.createParallelGroup(
+
org.jdesktop.layout.GroupLayout.BASELINE)
+
.add(applyButton)
+
.add(cancelButton))
+
.addContainerGap()));
- org.jdesktop.layout.GroupLayout layout = new
org.jdesktop.layout.GroupLayout(getContentPane());
+ org.jdesktop.layout.GroupLayout layout = new
org.jdesktop.layout.GroupLayout(
+ getContentPane());
getContentPane().setLayout(layout);
-
layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(mainPanel,
-
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
-
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE));
-
layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(mainPanel,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
-
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE));
+ layout.setHorizontalGroup(layout.createParallelGroup(
+
org.jdesktop.layout.GroupLayout.LEADING).add(mainPanel,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE));
+ layout.setVerticalGroup(layout.createParallelGroup(
+
org.jdesktop.layout.GroupLayout.LEADING).add(mainPanel,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE));
pack();
} // </editor-fold>
@@ -246,15 +260,15 @@
// End of variables declaration
/**
* DOCUMENT ME!
- *
+ *
* @return DOCUMENT ME!
*/
public Object getValue() {
-
- if(canceled == true) {
+
+ if (canceled == true) {
return originalValue;
}
-
+
final int selectedIndex = iconList.getSelectedIndex();
if ((0 <= selectedIndex) && (selectedIndex <
orderedKeyList.size()))
return orderedKeyList.get(selectedIndex);
@@ -272,35 +286,36 @@
iconList.setModel(model);
VisualPropertyIcon icon;
-
- final Map<String, Icon> name2icon = new HashMap<String,
Icon>();
- final Map<String, Object> name2value = new HashMap<String,
Object>();
+ final Map<String, Icon> name2icon = new HashMap<String, Icon>();
+ final Map<String, Object> name2value = new HashMap<String,
Object>();
+
for (Object key : iconMap.keySet()) {
icon = (VisualPropertyIcon) iconMap.get(key);
- if(type == EDGE_SRCARROW_SHAPE || type ==
EDGE_TGTARROW_SHAPE) {
- icon.setIconWidth(icon.getIconWidth()*3);
+ if (type == EDGE_SRCARROW_SHAPE || type ==
EDGE_TGTARROW_SHAPE) {
+ icon.setIconWidth(icon.getIconWidth() * 3);
}
- if(type.equals(NODE_SHAPE) &&
((NodeShape)key).isSupported() == false) {
+ if (type.equals(NODE_SHAPE)
+ && ((NodeShape) key).isSupported() ==
false) {
// Filter shapes not supported by current
rendering engine.
// Maybe supported in future versions...
continue;
}
final String keyName = icon.getName();
- if(name2icon.containsKey(keyName)) {
- name2icon.put(keyName+key.hashCode(), icon);
- name2value.put(keyName+key.hashCode(), key);
+ if (name2icon.containsKey(keyName)) {
+ name2icon.put(keyName + key.hashCode(), icon);
+ name2value.put(keyName + key.hashCode(), key);
} else {
name2icon.put(keyName, icon);
name2value.put(keyName, key);
}
}
-
+
TreeSet<String> sortedSet = new
TreeSet<String>(name2icon.keySet());
-
- for(String key:sortedSet) {
+
+ for (String key : sortedSet) {
orderedKeyList.add(name2value.get(key));
model.addElement(name2icon.get(key));
}
@@ -309,43 +324,46 @@
iconList.repaint();
}
-
- public class IconCellRenderer extends JLabel implements
ListCellRenderer {
-
+ private static final class IconCellRenderer extends JLabel implements
ListCellRenderer {
+
private static final long serialVersionUID =
-7235212695832080213L;
-
- private final Font SELECTED_FONT = new Font("SansSerif",
Font.ITALIC, 18);
+
+ private final Font SELECTED_FONT = new Font("SansSerif",
Font.ITALIC,
+ 18);
private final Font NORMAL_FONT = new Font("SansSerif",
Font.BOLD, 14);
private final Color SELECTED_COLOR = new Color(30, 30, 80, 25);
private final Color SELECTED_FONT_COLOR = new Color(0, 150,
255, 120);
-
+
private final Border DROPHSADOW = new DropShadowBorder();
public IconCellRenderer() {
setOpaque(true);
}
- public Component getListCellRendererComponent(JList list,
Object value, int index,
- boolean
isSelected, boolean cellHasFocus) {
+ public Component getListCellRendererComponent(JList list,
Object value,
+ int index, boolean isSelected, boolean
cellHasFocus) {
final VisualPropertyIcon icon = (VisualPropertyIcon)
value;
- if(value != null)
+ if (value != null)
setText(icon.getName());
+
+ if (icon != null) {
+ setIcon(icon);
+ setFont(isSelected ? SELECTED_FONT :
NORMAL_FONT);
+ icon.setLeftPadding(30);
+ setPreferredSize(new
Dimension(icon.getIconWidth() + 300,
+ icon.getIconHeight() + 20));
+ }
- setIcon(icon);
- setFont(isSelected ? SELECTED_FONT : NORMAL_FONT);
- icon.setLeftPadding(30);
-
this.setVerticalTextPosition(SwingConstants.CENTER);
this.setVerticalAlignment(SwingConstants.CENTER);
this.setIconTextGap(60);
setBackground(isSelected ? SELECTED_COLOR :
list.getBackground());
- setForeground(isSelected ? SELECTED_FONT_COLOR :
list.getForeground());
-
- setPreferredSize(new Dimension(icon.getIconWidth()+300,
icon.getIconHeight() + 20));
+ setForeground(isSelected ? SELECTED_FONT_COLOR : list
+ .getForeground());
+
this.setBorder(DROPHSADOW);
-
return this;
}
}
Modified: cytoscape/trunk/src/cytoscape/visual/ui/VizMapperMainPanel.java
===================================================================
--- cytoscape/trunk/src/cytoscape/visual/ui/VizMapperMainPanel.java
2010-07-15 23:23:07 UTC (rev 20942)
+++ cytoscape/trunk/src/cytoscape/visual/ui/VizMapperMainPanel.java
2010-07-15 23:57:52 UTC (rev 20943)
@@ -168,6 +168,7 @@
GLOBAL;
}
+ // Context menu items
private static JPopupMenu menu;
private static JMenuItem delete;
private static JMenuItem rainbow1;
@@ -211,7 +212,7 @@
/*
* Visual mapping manager. All parameters should be taken from here.
*/
- private VisualMappingManager vmm;
+ private final VisualMappingManager vmm;
/*
* Keeps Properties in the browser.
@@ -220,10 +221,9 @@
// Keeps current discrete mappings. NOT PERMANENT
private final Map<String, Map<Object, Object>> discMapBuffer = new
HashMap<String, Map<Object, Object>>();
- // MLC 03/31/08:
- // lastVSName is currently used as an efficiency hack to ignore the
expensive need
- // to update the visual style when the existing style is already that
style:
+
private String lastVSName = null;
+
private JScrollPane noMapListScrollPane;
private List<VisualPropertyType> noMapping;
private JPanel buttonPanel;
@@ -234,9 +234,9 @@
private boolean ignore = false;
private CyLogger logger = CyLogger.getLogger(VizMapperMainPanel.class);
-
private Set<VizMapperProperty> hiddenProperties = new
HashSet<VizMapperProperty>();
+
/** Creates new form AttributeOrientedPanel */
private VizMapperMainPanel() {
vmm = Cytoscape.getVisualMappingManager();
@@ -244,6 +244,7 @@
propertyMap = new HashMap<String, List<Property>>();
setMenu();
+ menu.addPopupMenuListener(this);
// Need to register listener here, instead of CytoscapeDesktop.
Cytoscape.getSwingPropertyChangeSupport().addPropertyChangeListener(this);
@@ -287,7 +288,7 @@
* @param deps The VisualPropertyDependencies that will be queried.
* @param def The VisualPropertyDependency.Definition in question.
*/
- protected void syncDependencyStates(VisualPropertyDependency deps,
Definition def) {
+ void syncDependencyStates(VisualPropertyDependency deps, Definition
def) {
dependencyMenuItems.get(def).setSelected(deps.check(def));
updateDependencyStates(deps);
@@ -417,8 +418,7 @@
editSelectedCells();
}
});
- // add.addActionListener(l)
- // select.setIcon(vmIcon);
+
menu = new JPopupMenu();
generateValues.add(rainbow1);
generateValues.add(rainbow2);
@@ -447,9 +447,9 @@
menu.add(dependencies);
delete.setEnabled(false);
- menu.addPopupMenuListener(this);
}
+
private void setupDependencyMenus(JMenu parentMenu) {
for ( final Definition def : Definition.values() ) {
final JCheckBoxMenuItem item = new
JCheckBoxMenuItem(def.getTitle());
@@ -2568,7 +2568,11 @@
}
private class GenerateValueListener extends AbstractAction {
- private final int MAX_COLOR = 256 * 256 * 256;
+
+ private static final long serialVersionUID =
-4852790777403019117L;
+
+ private static final int MAX_COLOR = 256 * 256 * 256;
+
private DiscreteMapping dm;
protected static final int RAINBOW1 = 1;
protected static final int RAINBOW2 = 2;
Modified: cytoscape/trunk/src/cytoscape/visual/ui/VizMapperProperty.java
===================================================================
--- cytoscape/trunk/src/cytoscape/visual/ui/VizMapperProperty.java
2010-07-15 23:23:07 UTC (rev 20942)
+++ cytoscape/trunk/src/cytoscape/visual/ui/VizMapperProperty.java
2010-07-15 23:57:52 UTC (rev 20943)
@@ -11,7 +11,10 @@
*
*/
public class VizMapperProperty extends DefaultProperty {
- private Object hiddenObject;
+
+ private static final long serialVersionUID = -9103147252041414576L;
+
+ private Object hiddenObject;
/**
* DOCUMENT ME!
Modified:
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/C2CMappingEditor.java
===================================================================
---
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/C2CMappingEditor.java
2010-07-15 23:23:07 UTC (rev 20942)
+++
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/C2CMappingEditor.java
2010-07-15 23:57:52 UTC (rev 20943)
@@ -177,8 +177,6 @@
// Add a new white thumb in the min.
slider.getModel().addThumb(position, value);
- // Update continuous mapping
- final Double newVal = maxValue;
// Pick Up first point.
final ContinuousMappingPoint previousPoint =
mapping.getPoint(mapping.getPointCount() - 1);
Modified:
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/DiscreteTrackRenderer.java
===================================================================
---
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/DiscreteTrackRenderer.java
2010-07-15 23:23:07 UTC (rev 20942)
+++
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/DiscreteTrackRenderer.java
2010-07-15 23:57:52 UTC (rev 20943)
@@ -646,14 +646,13 @@
double maxValue =
EditorValueRangeTracer.getTracer().getMax(type);
double valueRange =
EditorValueRangeTracer.getTracer().getRange(type);
- int track_width = iconWidth;
- int trackHeight = iconHeight - 8;
+ final int track_width = iconWidth;
+ final int trackHeight;
if(detail) {
trackHeight = iconHeight - 30;
smallIconSize = (int) (trackHeight * 0.5);
- } else {
+ } else
trackHeight = iconHeight - 8;
- }
// get the list of tumbs
final List<Thumb<T>> stops =
slider.getModel().getSortedThumbs();
Modified:
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/EditorValueRangeTracer.java
===================================================================
---
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/EditorValueRangeTracer.java
2010-07-15 23:23:07 UTC (rev 20942)
+++
cytoscape/trunk/src/cytoscape/visual/ui/editors/continuous/EditorValueRangeTracer.java
2010-07-15 23:57:52 UTC (rev 20943)
@@ -44,13 +44,14 @@
*
*/
public class EditorValueRangeTracer {
- private static EditorValueRangeTracer tracer;
+
+ private static final EditorValueRangeTracer tracer;
static {
tracer = new EditorValueRangeTracer();
}
- private final class Range {
+ private static final class Range {
private Double min;
private Double max;
Modified:
cytoscape/trunk/src/cytoscape/visual/ui/editors/discrete/CyComboBoxPropertyEditor.java
===================================================================
---
cytoscape/trunk/src/cytoscape/visual/ui/editors/discrete/CyComboBoxPropertyEditor.java
2010-07-15 23:23:07 UTC (rev 20942)
+++
cytoscape/trunk/src/cytoscape/visual/ui/editors/discrete/CyComboBoxPropertyEditor.java
2010-07-15 23:57:52 UTC (rev 20943)
@@ -171,7 +171,7 @@
component = new JLabel("Select Value!");
component.setForeground(SELECTED);
((JLabel) component).setFont(new
Font("SansSerif", Font.BOLD, 12));
- } else if(value == null && ((JComboBox)
editor).getItemCount() != 0) {
+ } else if(((JComboBox) editor).getItemCount() != 0) {
component = new JLabel(((JComboBox)
editor).getItemAt(0).toString());
component.setForeground(SELECTED);
((JLabel) component).setFont(new
Font("SansSerif", Font.BOLD, 12));
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.