Example usage for java.awt Color darkGray

List of usage examples for java.awt Color darkGray

Introduction

In this page you can find the example usage for java.awt Color darkGray.

Prototype

Color darkGray

To view the source code for java.awt Color darkGray.

Click Source Link

Document

The color dark gray.

Usage

From source file:ancat.visualizers.VertexTransformers.java

/**
 * Prepares the default colour configuration that is used by the rendering
 * engine//w  w  w  .  j  a v a  2s  .  c o  m
 */
private void colorConfig() {
    Map<String, String> nodeConfig = _renderConfig.nodeConfiguration();

    if (nodeConfig.containsKey("node:default-color")) {

        try {
            Color c = Color.decode(nodeConfig.get("node:default-color"));

            if (c != null)
                _defaultColor = c;
            else
                _defaultColor = Color.darkGray;
        } catch (NumberFormatException e) {
            _logger.error("Cannot process color value for node object", e);
            _defaultColor = Color.darkGray;
        }
    }

    if (nodeConfig.containsKey("node:default-pcolor")) {

        try {
            Color c = Color.decode(nodeConfig.get("node:default-pcolor"));

            if (c != null)
                _defaultpColor = c;
            else
                _defaultpColor = Color.lightGray;
        } catch (NumberFormatException e) {
            _logger.error("Cannot process color value for node object", e);
            _defaultpColor = Color.darkGray;
        }
    }
}

From source file:edu.cuny.cat.ui.ClockPanel.java

@Override
public void setup(final ParameterDatabase parameters, final Parameter base) {
    clock = GameController.getInstance().getClock();

    dataset = new DefaultValueDataset();

    meterplot = new MyMeterPlot(dataset) {
        /**//w ww.  j  av a 2 s.  co  m
         * 
         */
        private static final long serialVersionUID = 1L;

        @Override
        protected void drawValueLabel(final Graphics2D g2, final Rectangle2D area) {
            g2.setFont(getValueFont());
            g2.setPaint(getValuePaint());
            String valueStr = "No value";
            if (dataset != null) {
                final Number n = dataset.getValue();
                if (n != null) {
                    if (n.intValue() == 0) {
                        valueStr = "to start";
                    } else if (n.intValue() == clock.getGameLen() * clock.getDayLen()) {
                        valueStr = "done";
                    } else {
                        valueStr = "day " + (n.intValue() / clock.getDayLen()) + ", round "
                                + (n.intValue() % clock.getDayLen());
                    }
                }
            }
            final float x = (float) area.getCenterX();
            final float y = (float) area.getCenterY() + MeterPlot.DEFAULT_CIRCLE_SIZE;
            TextUtilities.drawAlignedString(valueStr, g2, x, y, TextAnchor.TOP_CENTER);
        }

    };
    meterplot.setRange(new Range(0, clock.getDayLen() * clock.getGameLen()));

    meterplot.setNeedlePaint(
            parameters.getColorWithDefault(base.push(ClockPanel.P_NEEDLE), null, Color.darkGray));

    meterplot.setDialBackgroundPaint(new Color(0, 255, 0, 64));
    meterplot.setDialOutlinePaint(Color.gray);
    meterplot.setDialShape(DialShape.CHORD);

    meterplot.setMeterAngle(parameters.getIntWithDefault(base.push(ClockPanel.P_ANGLE), null, 260));

    meterplot.setTickLabelsVisible(true);
    meterplot.setTickLabelFont(new Font("Dialog", 1, 10));
    meterplot.setTickLabelPaint(Color.darkGray);
    meterplot.setTickSize(clock.getDayLen());
    meterplot.setTickPaint(Color.lightGray);

    meterplot.setValuePaint(Color.black);
    meterplot.setValueFont(new Font("Dialog", 1, 14));
    meterplot.setUnits("");
    meterplot.setTickLabelFormat(new NumberFormat() {

        /**
         * 
         */
        private static final long serialVersionUID = 1L;

        @Override
        public StringBuffer format(final double number, final StringBuffer toAppendTo,
                final FieldPosition pos) {
            return format((long) number, toAppendTo, pos);
        }

        @Override
        public StringBuffer format(final long number, final StringBuffer toAppendTo, final FieldPosition pos) {

            if (number % clock.getDayLen() == 0) {
                toAppendTo.append(String.valueOf(number / clock.getDayLen()));
            }
            return toAppendTo;
        }

        @Override
        public Number parse(final String source, final ParsePosition parsePosition) {
            return null;
        }

    });

    final JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, meterplot, false);

    final ChartPanel panel = new ChartPanel(chart);
    panel.setPreferredSize(new Dimension(parameters.getIntWithDefault(base.push(ClockPanel.P_WIDTH), null, 200),
            parameters.getIntWithDefault(base.push(ClockPanel.P_HEIGHT), null, 200)));

    add(panel, BorderLayout.CENTER);

    initIterationLabel();

    initScoreReport();
}

From source file:com.xilinx.kintex7.PowerDial.java

public void createDial() {
    plot = new MeterPlot();
    dset = new DefaultValueDataset(0);
    plot.setUnits("Watts");
    plot.setRange(new Range(1, 10));
    plot.addInterval(new MeterInterval("Acceptable", new Range(1.0, 6.0), Color.lightGray,
            new BasicStroke(2.0f), Color.GREEN));
    plot.addInterval(new MeterInterval("Warning", new Range(6.0, 8.0), Color.lightGray, new BasicStroke(2.0f),
            Color.YELLOW));/* w  ww . ja  v  a 2 s.  c  om*/
    plot.addInterval(new MeterInterval("Dangerous", new Range(8.0, 10.0), Color.lightGray,
            new BasicStroke(2.0f), Color.RED));

    //sets different marks
    for (int i = 0; i < 10; i += 1) {
        if (i == 0)
            plot.addInterval(
                    new MeterInterval("", new Range(1, 1), Color.lightGray, new BasicStroke(2.0f), null));
        else
            plot.addInterval(
                    new MeterInterval("", new Range(i, i), Color.lightGray, new BasicStroke(2.0f), null));
    }
    plot.setNeedlePaint(Color.darkGray);
    plot.setDialBackgroundPaint(Color.white);
    plot.setDialOutlinePaint(Color.gray);
    plot.setDialShape(DialShape.PIE);
    plot.setMeterAngle(180);
    plot.setTickLabelsVisible(true);
    plot.setTickLabelFont(new Font("Dialog", Font.BOLD, 10));
    plot.setTickLabelPaint(Color.DARK_GRAY);
    plot.setTickSize(10.0);
    plot.setTickPaint(Color.lightGray);
    plot.setValuePaint(Color.BLACK);
    plot.setDataset(dset);

    LegendItemCollection legendItemsOld = plot.getLegendItems();
    final LegendItemCollection legendItemsNew = new LegendItemCollection();

    for (int i = 0; i < 3; i++) {
        LegendItem item = legendItemsOld.get(i);
        item.setLabelPaint(Color.WHITE);
        legendItemsNew.add(item);
    }

    LegendItemSource source = new LegendItemSource() {
        LegendItemCollection lic = new LegendItemCollection();
        {
            lic.addAll(legendItemsNew);
        }

        @Override
        public LegendItemCollection getLegendItems() {
            return lic;
        }
    };

    chart = new JFreeChart(plot);
    chart.addLegend(new LegendTitle(source));
    chart.removeLegend();
    chart.setTitle("");
    //chart.setBackgroundPaint(new GradientPaint(0,0,new Color(139,137,137),0,height,Color.BLUE ));
    //
    chart.getTitle().setPaint(Color.white);
    plot.setValueFont(new Font("Dialog", Font.BOLD, 14));
    //chartpanel = new ChartPanel(chart);
}

From source file:org.apache.oodt.cas.workflow.gui.perspective.view.impl.GlobalConfigView.java

@Override
public void refreshView(ViewState state) {

    Rectangle visibleRect = null;
    if (this.tree != null) {
        visibleRect = this.tree.getVisibleRect();
    }/*from ww  w . j a v a 2 s. c  o  m*/

    DefaultMutableTreeNode root = new DefaultMutableTreeNode("GlobalConfig");

    if (state != null && state.getGlobalConfigGroups() != null) {
        if (globalConfig != null && globalConfig.keySet().equals(state.getGlobalConfigGroups().keySet())
                && globalConfig.values().equals(state.getGlobalConfigGroups().values())) {
            return;
        }

        this.removeAll();

        for (ConfigGroup group : (globalConfig = state.getGlobalConfigGroups()).values()) {
            HashSet<String> keys = new HashSet<String>();
            DefaultMutableTreeNode groupNode = new DefaultMutableTreeNode(new Group(group.getName()));
            root.add(groupNode);
            for (String key : group.getMetadata().getAllKeys()) {
                keys.add(key);
                DefaultMutableTreeNode keyNode = new DefaultMutableTreeNode(new Key(key));
                groupNode.add(keyNode);
                DefaultMutableTreeNode valueNode = new DefaultMutableTreeNode(
                        new Value(StringUtils.join(group.getMetadata().getAllMetadata(key), ",")));
                keyNode.add(valueNode);
            }
            if (group.getExtends() != null) {
                List<String> extendsGroups = new Vector<String>(group.getExtends());
                Collections.reverse(extendsGroups);
                for (String extendsGroup : extendsGroups) {
                    List<String> groupKeys = state.getGlobalConfigGroups().get(extendsGroup).getMetadata()
                            .getAllKeys();
                    groupKeys.removeAll(keys);
                    if (groupKeys.size() > 0) {
                        for (String key : groupKeys) {
                            if (!keys.contains(key)) {
                                keys.add(key);
                                DefaultMutableTreeNode keyNode = new DefaultMutableTreeNode(
                                        new ExtendsKey(extendsGroup, key));
                                groupNode.add(keyNode);
                                DefaultMutableTreeNode valueNode = new DefaultMutableTreeNode(
                                        new ExtendsValue(StringUtils.join(state.getGlobalConfigGroups()
                                                .get(extendsGroup).getMetadata().getAllMetadata(key), ",")));
                                keyNode.add(valueNode);
                            }
                        }
                    }
                }
            }
        }

        tree = new JTree(root);
        tree.setShowsRootHandles(true);
        tree.setRootVisible(false);

        tree.setCellRenderer(new TreeCellRenderer() {

            public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected,
                    boolean expanded, boolean leaf, int row, boolean hasFocus) {
                DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
                if (node.getUserObject() instanceof Key) {
                    JPanel panel = new JPanel();
                    panel.setLayout(new BorderLayout());
                    JLabel label = new JLabel(node.getUserObject().toString());
                    label.setForeground(Color.darkGray);
                    panel.add(label, BorderLayout.CENTER);
                    panel.setBackground(selected ? Color.lightGray : Color.white);
                    return panel;
                } else if (node.getUserObject() instanceof ExtendsKey) {
                    JPanel panel = new JPanel();
                    panel.setLayout(new BorderLayout());
                    ExtendsKey key = (ExtendsKey) node.getUserObject();
                    JLabel groupLabel = new JLabel("(" + key.getGroup() + ") ");
                    groupLabel.setForeground(Color.black);
                    JLabel keyLabel = new JLabel(key.getValue());
                    keyLabel.setForeground(Color.gray);
                    panel.add(groupLabel, BorderLayout.WEST);
                    panel.add(keyLabel, BorderLayout.CENTER);
                    panel.setBackground(selected ? Color.lightGray : Color.white);
                    return panel;
                } else if (node.getUserObject() instanceof Group) {
                    JPanel panel = new JPanel();
                    panel.setLayout(new BorderLayout());
                    JLabel label = new JLabel(node.getUserObject().toString());
                    label.setForeground(Color.black);
                    label.setBackground(Color.white);
                    panel.add(label, BorderLayout.CENTER);
                    panel.setBackground(selected ? Color.lightGray : Color.white);
                    return panel;
                } else if (node.getUserObject() instanceof Value) {
                    JPanel panel = new JPanel();
                    panel.setLayout(new BorderLayout());
                    panel.setBorder(new EtchedBorder(1));
                    JLabel label = new JLabel(node.getUserObject().toString());
                    label.setForeground(Color.black);
                    panel.add(label, BorderLayout.CENTER);
                    panel.setBackground(selected ? Color.lightGray : Color.white);
                    return panel;
                } else if (node.getUserObject() instanceof ExtendsValue) {
                    JPanel panel = new JPanel();
                    panel.setLayout(new BorderLayout());
                    panel.setBorder(new EtchedBorder(1));
                    JLabel label = new JLabel(node.getUserObject().toString());
                    label.setForeground(Color.gray);
                    panel.add(label, BorderLayout.CENTER);
                    panel.setBackground(selected ? Color.lightGray : Color.white);
                    return panel;
                } else {
                    return new JLabel();
                }
            }

        });
    }

    this.setBorder(new EtchedBorder());
    JLabel panelName = new JLabel("Global-Config Groups");
    panelName.setBorder(new EtchedBorder());
    this.add(panelName, BorderLayout.NORTH);
    JScrollPane scrollPane = new JScrollPane(tree, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

    tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Tree", scrollPane);
    tabbedPane.addTab("Table", new JPanel());

    this.add(tabbedPane, BorderLayout.CENTER);

    if (visibleRect != null) {
        this.tree.scrollRectToVisible(visibleRect);
    }

    this.revalidate();
}

From source file:savant.view.tracks.ContinuousTrackRenderer.java

@Override
public void render(Graphics2D g2, GraphPaneAdapter gp) throws RenderingException {

    renderPreCheck();//ww w  . ja v  a2s .co  m

    AxisRange axisRange = (AxisRange) instructions.get(DrawingInstruction.AXIS_RANGE);
    gp.setXRange(axisRange.getXRange());
    gp.setYRange(axisRange.getYRange());

    if (gp.needsToResize())
        return;

    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

    ColourScheme cs = (ColourScheme) instructions.get(DrawingInstruction.COLOUR_SCHEME);
    Color fillcolor = cs.getColor(ColourKey.CONTINUOUS_FILL);
    Color linecolor = cs.getColor(ColourKey.CONTINUOUS_LINE);

    GeneralPath path = new GeneralPath();
    double xFormXPos = Double.NaN, xFormYPos = Double.NaN;

    double yPixel0 = gp.transformYPos(0.0);
    LOG.debug("h=" + gp.getHeight() + ", yMin=" + gp.getYRange().getFrom() + ", unitHeight="
            + gp.getUnitHeight() + " \u27A4 yPixel0=" + yPixel0);

    double maxData = 0;
    boolean haveOpenPath = false;
    boolean haveData = false;
    if (data != null) {
        for (int i = 0; i < data.size(); i++) {
            ContinuousRecord continuousRecord = (ContinuousRecord) data.get(i);
            int xPos = continuousRecord.getPosition();
            float yPos = continuousRecord.getValue();
            if (Float.isNaN(yPos)) {
                // Hit a position with no data.  May need to close off the current path.
                if (haveOpenPath) {
                    path.lineTo(xFormXPos, yPixel0);
                    path.closePath();
                    haveOpenPath = false;
                }
            } else {
                haveData = true;
                xFormXPos = gp.transformXPos(xPos);//+gp.getUnitWidth()/2;
                xFormYPos = gp.transformYPos(yPos);
                if (!haveOpenPath) {
                    // Start our path off with a vertical line.
                    path.moveTo(xFormXPos, yPixel0);
                    haveOpenPath = true;
                }
                path.lineTo(xFormXPos, xFormYPos);
                Rectangle2D rec = new Rectangle2D.Double(
                        xFormXPos - ((xFormXPos - path.getCurrentPoint().getX()) / 2), 0,
                        Math.max(xFormXPos - path.getCurrentPoint().getX(), 1), gp.getHeight());
                recordToShapeMap.put(continuousRecord, rec);
                xFormXPos = gp.transformXPos(xPos + 1);
                path.lineTo(xFormXPos, xFormYPos);
            }
            if (yPos > maxData) {
                maxData = yPos;
            }
        }
    }
    if (!haveData) {
        throw new RenderingException("No data in range", RenderingException.INFO_PRIORITY);
    }
    if (haveOpenPath) {
        // Path needs to be closed.
        path.lineTo(xFormXPos, yPixel0);
        path.closePath();
    }

    g2.setColor(fillcolor);
    g2.fill(path);
    g2.setColor(linecolor);
    g2.draw(path);

    if (axisRange.getYRange().getFrom() < 0) {
        g2.setColor(Color.darkGray);
        g2.draw(new Line2D.Double(0.0, yPixel0, gp.getWidth(), yPixel0));
    }
}

From source file:demos.MinimumSpanningTreeDemo.java

/**
 * create an instance of a simple graph in two views with controls to demo
 * the zoom features.//from  ww w . ja  v a  2  s  .  co  m
 * 
 */
public MinimumSpanningTreeDemo() {

    // create a simple graph for the demo
    // both models will share one graph
    graph = TestGraphs.getDemoGraph();

    MinimumSpanningForest2<String, Number> prim = new MinimumSpanningForest2<String, Number>(graph,
            new DelegateForest<String, Number>(), DelegateTree.<String, Number>getFactory(),
            new ConstantTransformer(1.0));

    tree = prim.getForest();

    // create two layouts for the one graph, one layout for each model
    Layout<String, Number> layout0 = new KKLayout<String, Number>(graph);
    layout0.setSize(preferredLayoutSize);
    Layout<String, Number> layout1 = new TreeLayout<String, Number>(tree);
    Layout<String, Number> layout2 = new StaticLayout<String, Number>(graph, layout1);

    // create the two models, each with a different layout
    VisualizationModel<String, Number> vm0 = new DefaultVisualizationModel<String, Number>(layout0,
            preferredSize);
    VisualizationModel<String, Number> vm1 = new DefaultVisualizationModel<String, Number>(layout1,
            preferredSizeRect);
    VisualizationModel<String, Number> vm2 = new DefaultVisualizationModel<String, Number>(layout2,
            preferredSizeRect);

    // create the two views, one for each model
    // they share the same renderer
    vv0 = new VisualizationViewer<String, Number>(vm0, preferredSize);
    vv1 = new VisualizationViewer<String, Number>(vm1, preferredSizeRect);
    vv2 = new VisualizationViewer<String, Number>(vm2, preferredSizeRect);

    // vv1.setRenderContext(vv2.getRenderContext());

    vv1.getRenderContext().setMultiLayerTransformer(vv0.getRenderContext().getMultiLayerTransformer());
    vv2.getRenderContext().setMultiLayerTransformer(vv0.getRenderContext().getMultiLayerTransformer());

    vv1.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line());

    vv0.addChangeListener(vv1);
    vv1.addChangeListener(vv2);

    vv0.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
    vv2.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());

    Color back = Color.decode("0xffffbb");
    vv0.setBackground(back);
    vv1.setBackground(back);
    vv2.setBackground(back);

    vv0.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
    vv0.setForeground(Color.darkGray);
    vv1.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
    vv1.setForeground(Color.darkGray);
    vv2.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
    vv2.setForeground(Color.darkGray);

    // share one PickedState between the two views
    PickedState<String> ps = new MultiPickedState<String>();
    vv0.setPickedVertexState(ps);
    vv1.setPickedVertexState(ps);
    vv2.setPickedVertexState(ps);

    PickedState<Number> pes = new MultiPickedState<Number>();
    vv0.setPickedEdgeState(pes);
    vv1.setPickedEdgeState(pes);
    vv2.setPickedEdgeState(pes);

    // set an edge paint function that will show picking for edges
    vv0.getRenderContext().setEdgeDrawPaintTransformer(
            new PickableEdgePaintTransformer<Number>(vv0.getPickedEdgeState(), Color.black, Color.red));
    vv0.getRenderContext().setVertexFillPaintTransformer(
            new PickableVertexPaintTransformer<String>(vv0.getPickedVertexState(), Color.red, Color.yellow));
    vv1.getRenderContext().setEdgeDrawPaintTransformer(
            new PickableEdgePaintTransformer<Number>(vv1.getPickedEdgeState(), Color.black, Color.red));
    vv1.getRenderContext().setVertexFillPaintTransformer(
            new PickableVertexPaintTransformer<String>(vv1.getPickedVertexState(), Color.red, Color.yellow));

    // add default listeners for ToolTips
    vv0.setVertexToolTipTransformer(new ToStringLabeller());
    vv1.setVertexToolTipTransformer(new ToStringLabeller());
    vv2.setVertexToolTipTransformer(new ToStringLabeller());

    vv0.setLayout(new BorderLayout());
    vv1.setLayout(new BorderLayout());
    vv2.setLayout(new BorderLayout());

    Font font = vv0.getFont().deriveFont(Font.BOLD, 16);
    JLabel vv0Label = new JLabel("<html>Original Graph<p>using KKLayout");
    vv0Label.setFont(font);
    JLabel vv1Label = new JLabel("Minimum Spanning Trees");
    vv1Label.setFont(font);
    JLabel vv2Label = new JLabel("Original Graph using TreeLayout");
    vv2Label.setFont(font);
    JPanel flow0 = new JPanel();
    flow0.setOpaque(false);
    JPanel flow1 = new JPanel();
    flow1.setOpaque(false);
    JPanel flow2 = new JPanel();
    flow2.setOpaque(false);
    flow0.add(vv0Label);
    flow1.add(vv1Label);
    flow2.add(vv2Label);
    vv0.add(flow0, BorderLayout.NORTH);
    vv1.add(flow1, BorderLayout.NORTH);
    vv2.add(flow2, BorderLayout.NORTH);

    // vv2.getRenderContext().setEdgeDrawPaintTransformer(new
    // Transformer<Number,Paint>() {
    //
    // public Paint transform(Number e) {
    // if(tree.getEdges().contains(e) == false) return Color.lightGray;
    // return Color.black;
    // }});

    Container content = getContentPane();
    JPanel grid = new JPanel(new GridLayout(0, 1));
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new GraphZoomScrollPane(vv0), BorderLayout.WEST);
    grid.add(new GraphZoomScrollPane(vv1));
    grid.add(new GraphZoomScrollPane(vv2));
    // panel.add(new GraphZoomScrollPane(vv3), BorderLayout.EAST);
    panel.add(grid);

    content.add(panel);

    // create a GraphMouse for each view
    DefaultModalGraphMouse gm0 = new DefaultModalGraphMouse();
    DefaultModalGraphMouse gm1 = new DefaultModalGraphMouse();
    DefaultModalGraphMouse gm2 = new DefaultModalGraphMouse();
    DefaultModalGraphMouse gm3 = new DefaultModalGraphMouse();

    vv0.setGraphMouse(gm0);
    vv1.setGraphMouse(gm1);
    vv2.setGraphMouse(gm2);
    // vv3.setGraphMouse(gm3);

    // create zoom buttons for scaling the transformer that is
    // shared between the two models.
    final ScalingControl scaler = new CrossoverScalingControl();

    vv0.scaleToLayout(scaler);
    vv1.scaleToLayout(scaler);
    vv2.scaleToLayout(scaler);
    // vv3.scaleToLayout(scaler);

    JButton plus = new JButton("+");
    plus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv1, 1.1f, vv1.getCenter());
        }
    });
    JButton minus = new JButton("-");
    minus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv1, 1 / 1.1f, vv1.getCenter());
        }
    });

    JPanel zoomPanel = new JPanel(new GridLayout(1, 2));
    zoomPanel.setBorder(BorderFactory.createTitledBorder("Zoom"));

    JPanel modePanel = new JPanel();
    modePanel.setBorder(BorderFactory.createTitledBorder("Mouse Mode"));
    gm1.getModeComboBox().addItemListener(gm2.getModeListener());
    gm1.getModeComboBox().addItemListener(gm0.getModeListener());
    gm1.getModeComboBox().addItemListener(gm3.getModeListener());
    modePanel.add(gm1.getModeComboBox());

    JPanel controls = new JPanel();
    zoomPanel.add(plus);
    zoomPanel.add(minus);
    controls.add(zoomPanel);
    controls.add(modePanel);
    content.add(controls, BorderLayout.SOUTH);
}

From source file:com.google.code.facebook.graph.sna.applet.MinimumSpanningTreeDemo.java

/**
 * create an instance of a simple graph in two views with controls to
 * demo the zoom features.// w w w  . ja  v  a2  s .  c o m
 * 
 */
public MinimumSpanningTreeDemo() {

    // create a simple graph for the demo
    // both models will share one graph
    graph = TestGraphs.getDemoGraph();

    MinimumSpanningForest2<String, Number> prim = new MinimumSpanningForest2<String, Number>(graph,
            new DelegateForest<String, Number>(), DelegateTree.<String, Number>getFactory(),
            new ConstantTransformer(1.0));

    tree = prim.getForest();

    // create two layouts for the one graph, one layout for each model
    Layout<String, Number> layout0 = new KKLayout<String, Number>(graph);
    layout0.setSize(preferredLayoutSize);
    Layout<String, Number> layout1 = new TreeLayout<String, Number>(tree);
    Layout<String, Number> layout2 = new StaticLayout<String, Number>(graph, layout1);

    // create the two models, each with a different layout
    VisualizationModel<String, Number> vm0 = new DefaultVisualizationModel<String, Number>(layout0,
            preferredSize);
    VisualizationModel<String, Number> vm1 = new DefaultVisualizationModel<String, Number>(layout1,
            preferredSizeRect);
    VisualizationModel<String, Number> vm2 = new DefaultVisualizationModel<String, Number>(layout2,
            preferredSizeRect);

    // create the two views, one for each model
    // they share the same renderer
    vv0 = new VisualizationViewer<String, Number>(vm0, preferredSize);
    vv1 = new VisualizationViewer<String, Number>(vm1, preferredSizeRect);
    vv2 = new VisualizationViewer<String, Number>(vm2, preferredSizeRect);

    //        vv1.setRenderContext(vv2.getRenderContext());

    vv1.getRenderContext().setMultiLayerTransformer(vv0.getRenderContext().getMultiLayerTransformer());
    vv2.getRenderContext().setMultiLayerTransformer(vv0.getRenderContext().getMultiLayerTransformer());

    vv1.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line());

    vv0.addChangeListener(vv1);
    vv1.addChangeListener(vv2);

    vv0.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
    vv2.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());

    Color back = Color.decode("0xffffbb");
    vv0.setBackground(back);
    vv1.setBackground(back);
    vv2.setBackground(back);

    vv0.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
    vv0.setForeground(Color.darkGray);
    vv1.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
    vv1.setForeground(Color.darkGray);
    vv2.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
    vv2.setForeground(Color.darkGray);

    // share one PickedState between the two views
    PickedState<String> ps = new MultiPickedState<String>();
    vv0.setPickedVertexState(ps);
    vv1.setPickedVertexState(ps);
    vv2.setPickedVertexState(ps);

    PickedState<Number> pes = new MultiPickedState<Number>();
    vv0.setPickedEdgeState(pes);
    vv1.setPickedEdgeState(pes);
    vv2.setPickedEdgeState(pes);

    // set an edge paint function that will show picking for edges
    vv0.getRenderContext().setEdgeDrawPaintTransformer(
            new PickableEdgePaintTransformer<Number>(vv0.getPickedEdgeState(), Color.black, Color.red));
    vv0.getRenderContext().setVertexFillPaintTransformer(
            new PickableVertexPaintTransformer<String>(vv0.getPickedVertexState(), Color.red, Color.yellow));
    vv1.getRenderContext().setEdgeDrawPaintTransformer(
            new PickableEdgePaintTransformer<Number>(vv1.getPickedEdgeState(), Color.black, Color.red));
    vv1.getRenderContext().setVertexFillPaintTransformer(
            new PickableVertexPaintTransformer<String>(vv1.getPickedVertexState(), Color.red, Color.yellow));

    // add default listeners for ToolTips
    vv0.setVertexToolTipTransformer(new ToStringLabeller());
    vv1.setVertexToolTipTransformer(new ToStringLabeller());
    vv2.setVertexToolTipTransformer(new ToStringLabeller());

    vv0.setLayout(new BorderLayout());
    vv1.setLayout(new BorderLayout());
    vv2.setLayout(new BorderLayout());

    Font font = vv0.getFont().deriveFont(Font.BOLD, 16);
    JLabel vv0Label = new JLabel("<html>Original Graph<p>using KKLayout");
    vv0Label.setFont(font);
    JLabel vv1Label = new JLabel("Minimum Spanning Trees");
    vv1Label.setFont(font);
    JLabel vv2Label = new JLabel("Original Graph using TreeLayout");
    vv2Label.setFont(font);
    JPanel flow0 = new JPanel();
    flow0.setOpaque(false);
    JPanel flow1 = new JPanel();
    flow1.setOpaque(false);
    JPanel flow2 = new JPanel();
    flow2.setOpaque(false);
    flow0.add(vv0Label);
    flow1.add(vv1Label);
    flow2.add(vv2Label);
    vv0.add(flow0, BorderLayout.NORTH);
    vv1.add(flow1, BorderLayout.NORTH);
    vv2.add(flow2, BorderLayout.NORTH);

    //        vv2.getRenderContext().setEdgeDrawPaintTransformer(new Transformer<Number,Paint>() {
    //
    //         public Paint transform(Number e) {
    //            if(tree.getEdges().contains(e) == false) return Color.lightGray;
    //            return Color.black;
    //         }});

    Container content = getContentPane();
    JPanel grid = new JPanel(new GridLayout(0, 1));
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new GraphZoomScrollPane(vv0), BorderLayout.WEST);
    grid.add(new GraphZoomScrollPane(vv1));
    grid.add(new GraphZoomScrollPane(vv2));
    //        panel.add(new GraphZoomScrollPane(vv3), BorderLayout.EAST);
    panel.add(grid);

    content.add(panel);

    // create a GraphMouse for each view
    DefaultModalGraphMouse gm0 = new DefaultModalGraphMouse();
    DefaultModalGraphMouse gm1 = new DefaultModalGraphMouse();
    DefaultModalGraphMouse gm2 = new DefaultModalGraphMouse();
    DefaultModalGraphMouse gm3 = new DefaultModalGraphMouse();

    vv0.setGraphMouse(gm0);
    vv1.setGraphMouse(gm1);
    vv2.setGraphMouse(gm2);
    //        vv3.setGraphMouse(gm3);

    // create zoom buttons for scaling the transformer that is
    // shared between the two models.
    final ScalingControl scaler = new CrossoverScalingControl();

    vv0.scaleToLayout(scaler);
    vv1.scaleToLayout(scaler);
    vv2.scaleToLayout(scaler);
    //        vv3.scaleToLayout(scaler);

    JButton plus = new JButton("+");
    plus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv1, 1.1f, vv1.getCenter());
        }
    });
    JButton minus = new JButton("-");
    minus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv1, 1 / 1.1f, vv1.getCenter());
        }
    });

    JPanel zoomPanel = new JPanel(new GridLayout(1, 2));
    zoomPanel.setBorder(BorderFactory.createTitledBorder("Zoom"));

    JPanel modePanel = new JPanel();
    modePanel.setBorder(BorderFactory.createTitledBorder("Mouse Mode"));
    gm1.getModeComboBox().addItemListener(gm2.getModeListener());
    gm1.getModeComboBox().addItemListener(gm0.getModeListener());
    gm1.getModeComboBox().addItemListener(gm3.getModeListener());
    modePanel.add(gm1.getModeComboBox());

    JPanel controls = new JPanel();
    zoomPanel.add(plus);
    zoomPanel.add(minus);
    controls.add(zoomPanel);
    controls.add(modePanel);
    content.add(controls, BorderLayout.SOUTH);
}

From source file:edu.ucsf.valelab.spotintensityanalysis.plot.PlotUtils.java

/**
 * Create a frame with a plot of the data given in XYSeries overwrite any
 * previously created frame with the same title
 *
        //from  w w  w.  ja  v a2  s.co  m
 * @param title shown in the top of the plot
 * @param data array with data series to be plotted
 * @param xTitle Title of the X axis
 * @param yTitle Title of the Y axis
 * @param showShapes whether or not to draw shapes at the data points
 * @param annotation to be shown in plot
 * @return Frame that displays the data
 */
public Frame plotDataN(String title, XYSeries[] data, String xTitle, String yTitle, boolean[] showShapes,
        String annotation) {

    // JFreeChart code
    XYSeriesCollection dataset = new XYSeriesCollection();
    // calculate min and max to scale the graph
    double minX, minY, maxX, maxY;
    minX = data[0].getMinX();
    minY = data[0].getMinY();
    maxX = data[0].getMaxX();
    maxY = data[0].getMaxY();
    for (XYSeries d : data) {
        dataset.addSeries(d);
        if (d.getMinX() < minX) {
            minX = d.getMinX();
        }
        if (d.getMaxX() > maxX) {
            maxX = d.getMaxX();
        }
        if (d.getMinY() < minY) {
            minY = d.getMinY();
        }
        if (d.getMaxY() > maxY) {
            maxY = d.getMaxY();
        }
    }

    JFreeChart chart = ChartFactory.createScatterPlot(title, // Title
            xTitle, // x-axis Label
            yTitle, // y-axis Label
            dataset, // Dataset
            PlotOrientation.VERTICAL, // Plot Orientation
            true, // Show Legend
            true, // Use tooltips
            false // Configure chart to generate URLs?
    );
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setRangeGridlinePaint(Color.lightGray);

    XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
    renderer.setBaseShapesVisible(true);

    for (int i = 0; i < data.length; i++) {
        renderer.setSeriesFillPaint(i, Color.white);
        renderer.setSeriesLinesVisible(i, true);
    }

    renderer.setSeriesPaint(0, Color.blue);
    Shape circle = new Ellipse2D.Float(-2.0f, -2.0f, 4.0f, 4.0f);
    renderer.setSeriesShape(0, circle, false);

    if (data.length > 1) {
        renderer.setSeriesPaint(1, Color.red);
        Shape square = new Rectangle2D.Float(-2.0f, -2.0f, 4.0f, 4.0f);
        renderer.setSeriesShape(1, square, false);
    }
    if (data.length > 2) {
        renderer.setSeriesPaint(2, Color.darkGray);
        Shape rect = new Rectangle2D.Float(-2.0f, -1.0f, 4.0f, 2.0f);
        renderer.setSeriesShape(2, rect, false);
    }
    if (data.length > 3) {
        renderer.setSeriesPaint(3, Color.magenta);
        Shape rect = new Rectangle2D.Float(-1.0f, -2.0f, 2.0f, 4.0f);
        renderer.setSeriesShape(3, rect, false);
    }

    for (int i = 0; i < data.length; i++) {
        if (showShapes.length > i && !showShapes[i]) {
            renderer.setSeriesShapesVisible(i, false);
        }
    }

    // place annotation at 80 % of max X, maxY
    XYAnnotation an = new XYTextAnnotation(annotation, maxX - 0.2 * (maxX - minX), maxY);
    plot.addAnnotation(an);

    renderer.setUseFillPaint(true);

    if (graphFrame_ == null)
        graphFrame_ = new MyChartFrame(title, chart);
    else
        graphFrame_.getChartPanel().setChart(chart);
    graphFrame_.getChartPanel().setMouseWheelEnabled(true);
    graphFrame_.pack();
    final MyChartFrame privateFrame = graphFrame_;
    graphFrame_.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent arg0) {
            privateFrame.dispose();
        }
    });

    graphFrame_.setVisible(true);

    return graphFrame_;
}

From source file:edu.uci.ics.jung.samples.MinimumSpanningTreeDemo.java

/**
 * create an instance of a simple graph in two views with controls to
 * demo the zoom features.//from   w ww  .  j a  v  a  2 s.  c  o m
 * 
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public MinimumSpanningTreeDemo() {

    // create a simple graph for the demo
    // both models will share one graph
    graph = TestGraphs.getDemoGraph();

    MinimumSpanningForest2<String, Number> prim = new MinimumSpanningForest2<String, Number>(graph,
            new DelegateForest<String, Number>(), DelegateTree.<String, Number>getFactory(),
            new ConstantTransformer(1.0));

    tree = prim.getForest();

    // create two layouts for the one graph, one layout for each model
    Layout<String, Number> layout0 = new KKLayout<String, Number>(graph);
    layout0.setSize(preferredLayoutSize);
    Layout<String, Number> layout1 = new TreeLayout<String, Number>(tree);
    Layout<String, Number> layout2 = new StaticLayout<String, Number>(graph, layout1);

    // create the two models, each with a different layout
    VisualizationModel<String, Number> vm0 = new DefaultVisualizationModel<String, Number>(layout0,
            preferredSize);
    VisualizationModel<String, Number> vm1 = new DefaultVisualizationModel<String, Number>(layout1,
            preferredSizeRect);
    VisualizationModel<String, Number> vm2 = new DefaultVisualizationModel<String, Number>(layout2,
            preferredSizeRect);

    // create the two views, one for each model
    // they share the same renderer
    vv0 = new VisualizationViewer<String, Number>(vm0, preferredSize);
    vv1 = new VisualizationViewer<String, Number>(vm1, preferredSizeRect);
    vv2 = new VisualizationViewer<String, Number>(vm2, preferredSizeRect);

    //        vv1.setRenderContext(vv2.getRenderContext());

    vv1.getRenderContext().setMultiLayerTransformer(vv0.getRenderContext().getMultiLayerTransformer());
    vv2.getRenderContext().setMultiLayerTransformer(vv0.getRenderContext().getMultiLayerTransformer());

    vv1.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line());

    vv0.addChangeListener(vv1);
    vv1.addChangeListener(vv2);

    vv0.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
    vv2.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());

    Color back = Color.decode("0xffffbb");
    vv0.setBackground(back);
    vv1.setBackground(back);
    vv2.setBackground(back);

    vv0.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
    vv0.setForeground(Color.darkGray);
    vv1.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
    vv1.setForeground(Color.darkGray);
    vv2.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
    vv2.setForeground(Color.darkGray);

    // share one PickedState between the two views
    PickedState<String> ps = new MultiPickedState<String>();
    vv0.setPickedVertexState(ps);
    vv1.setPickedVertexState(ps);
    vv2.setPickedVertexState(ps);

    PickedState<Number> pes = new MultiPickedState<Number>();
    vv0.setPickedEdgeState(pes);
    vv1.setPickedEdgeState(pes);
    vv2.setPickedEdgeState(pes);

    // set an edge paint function that will show picking for edges
    vv0.getRenderContext().setEdgeDrawPaintTransformer(
            new PickableEdgePaintTransformer<Number>(vv0.getPickedEdgeState(), Color.black, Color.red));
    vv0.getRenderContext().setVertexFillPaintTransformer(
            new PickableVertexPaintTransformer<String>(vv0.getPickedVertexState(), Color.red, Color.yellow));
    vv1.getRenderContext().setEdgeDrawPaintTransformer(
            new PickableEdgePaintTransformer<Number>(vv1.getPickedEdgeState(), Color.black, Color.red));
    vv1.getRenderContext().setVertexFillPaintTransformer(
            new PickableVertexPaintTransformer<String>(vv1.getPickedVertexState(), Color.red, Color.yellow));

    // add default listeners for ToolTips
    vv0.setVertexToolTipTransformer(new ToStringLabeller());
    vv1.setVertexToolTipTransformer(new ToStringLabeller());
    vv2.setVertexToolTipTransformer(new ToStringLabeller());

    vv0.setLayout(new BorderLayout());
    vv1.setLayout(new BorderLayout());
    vv2.setLayout(new BorderLayout());

    Font font = vv0.getFont().deriveFont(Font.BOLD, 16);
    JLabel vv0Label = new JLabel("<html>Original Graph<p>using KKLayout");
    vv0Label.setFont(font);
    JLabel vv1Label = new JLabel("Minimum Spanning Trees");
    vv1Label.setFont(font);
    JLabel vv2Label = new JLabel("Original Graph using TreeLayout");
    vv2Label.setFont(font);
    JPanel flow0 = new JPanel();
    flow0.setOpaque(false);
    JPanel flow1 = new JPanel();
    flow1.setOpaque(false);
    JPanel flow2 = new JPanel();
    flow2.setOpaque(false);
    flow0.add(vv0Label);
    flow1.add(vv1Label);
    flow2.add(vv2Label);
    vv0.add(flow0, BorderLayout.NORTH);
    vv1.add(flow1, BorderLayout.NORTH);
    vv2.add(flow2, BorderLayout.NORTH);

    //        vv2.getRenderContext().setEdgeDrawPaintTransformer(new Transformer<Number,Paint>() {
    //
    //         public Paint transform(Number e) {
    //            if(tree.getEdges().contains(e) == false) return Color.lightGray;
    //            return Color.black;
    //         }});

    Container content = getContentPane();
    JPanel grid = new JPanel(new GridLayout(0, 1));
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new GraphZoomScrollPane(vv0), BorderLayout.WEST);
    grid.add(new GraphZoomScrollPane(vv1));
    grid.add(new GraphZoomScrollPane(vv2));
    //        panel.add(new GraphZoomScrollPane(vv3), BorderLayout.EAST);
    panel.add(grid);

    content.add(panel);

    // create a GraphMouse for each view
    DefaultModalGraphMouse gm0 = new DefaultModalGraphMouse();
    DefaultModalGraphMouse gm1 = new DefaultModalGraphMouse();
    DefaultModalGraphMouse gm2 = new DefaultModalGraphMouse();
    DefaultModalGraphMouse gm3 = new DefaultModalGraphMouse();

    vv0.setGraphMouse(gm0);
    vv1.setGraphMouse(gm1);
    vv2.setGraphMouse(gm2);
    //        vv3.setGraphMouse(gm3);

    // create zoom buttons for scaling the transformer that is
    // shared between the two models.
    final ScalingControl scaler = new CrossoverScalingControl();

    vv0.scaleToLayout(scaler);
    vv1.scaleToLayout(scaler);
    vv2.scaleToLayout(scaler);
    //        vv3.scaleToLayout(scaler);

    JButton plus = new JButton("+");
    plus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv1, 1.1f, vv1.getCenter());
        }
    });
    JButton minus = new JButton("-");
    minus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv1, 1 / 1.1f, vv1.getCenter());
        }
    });

    JPanel zoomPanel = new JPanel(new GridLayout(1, 2));
    zoomPanel.setBorder(BorderFactory.createTitledBorder("Zoom"));

    JPanel modePanel = new JPanel();
    modePanel.setBorder(BorderFactory.createTitledBorder("Mouse Mode"));
    gm1.getModeComboBox().addItemListener(gm2.getModeListener());
    gm1.getModeComboBox().addItemListener(gm0.getModeListener());
    gm1.getModeComboBox().addItemListener(gm3.getModeListener());
    modePanel.add(gm1.getModeComboBox());

    JPanel controls = new JPanel();
    zoomPanel.add(plus);
    zoomPanel.add(minus);
    controls.add(zoomPanel);
    controls.add(modePanel);
    content.add(controls, BorderLayout.SOUTH);
}

From source file:tufts.vue.ui.InspectorPane.java

public InspectorPane() {
    super("Info");

    stack = this;

    Widget.setWantsScroller(stack, true);
    Widget.setWantsScrollerAlways(stack, true);

    final float EXACT_SIZE = 0f;
    final float EXPANDER = 1f;

    mDescription.setBorder(GUI.WidgetInsetBorder);
    mDescription.setOpaque(true);/* w  w w  .  jav a2s.  c  om*/
    mDescription.setBackground(Color.white);

    mSelectionInfo.setFont(tufts.vue.gui.GUI.StatusFace);
    //mSelectionInfo.setFont(tufts.vue.gui.GUI.StatusFaceSmall);
    //mSelectionInfo.setFont(VueConstants.SmallFont);
    mSelectionInfo.setForeground(Color.darkGray);
    mSelectionInfo.setBorder(GUI.WidgetInsetBorder);

    new Pane("_multi-selection-info", mSelectionInfo, EXACT_SIZE, 0);
    new Pane(VueResources.getString("inspectorpane.label"), mLabelPane, EXACT_SIZE, INFO + NOTES + KEYWORD);
    new Pane(VueResources.getString("inspectorpane.contentpreviews"), mPreview, EXACT_SIZE, RESOURCE);
    new Pane(VueResources.getString("inspectorpane.datasetfields"), mDataSetData, EXACT_SIZE,
            INFO + NOTES + KEYWORD + DATA);
    new Pane(VueResources.getString("inspectorpane.contentinfo"), mResourceMetaData, EXACT_SIZE, RESOURCE);
    new Pane(VueResources.getString("inspectorpane.contentsummary"), mDescription, 0.5f, RESOURCE + DATA);
    new Pane(VueResources.getString("nodeNotesTabName"), mNotes, EXACT_SIZE, INFO + NOTES);
    new Pane(VueResources.getString("inspectorpane.pathwaynotes"), mPathwayNotes, EXPANDER, INFO + NOTES);
    new Pane(VueResources.getString("jlabel.keyword"), mKeywords, EXACT_SIZE, KEYWORD);
    new Pane(VueResources.getString("combobox.mergepropertychoices.ontologicalmembership"), ontologicalMetadata,
            EXACT_SIZE, 0);

    for (Pane p : Pane.AllPanes)
        stack.addPane(p.name, p.widget, p.size);

    VUE.getSelection().addListener(this);
    VUE.addActiveListener(LWComponent.class, this);
    VUE.addActiveListener(Resource.class, this);
    VUE.addActiveListener(LWPathway.Entry.class, this);
    VUE.addActiveListener(MetaMap.class, this);
    //VUE.getResourceSelection().addListener(this);

    Widget.setHelpAction(mLabelPane, VueResources.getString("dockWindow.Info.summaryPane.helpText"));
    ;
    Widget.setHelpAction(mPreview, VueResources.getString("dockWindow.Info.previewPane.helpText"));
    ;
    Widget.setHelpAction(mResourceMetaData, VueResources.getString("dockWindow.Info.resourcePane.helpText"));
    ;
    Widget.setHelpAction(mNotes, VueResources.getString("dockWindow.Info.notesPane.helpText"));
    ;
    Widget.setHelpAction(mKeywords, VueResources.getString("dockWindow.Info.userPane.helpText"));
    ;
    Widget.setHelpAction(ontologicalMetadata,
            VueResources.getString("dockWindow.Info.ontologicalMetadata.helpText"));

    //Set the default state of the inspector pane to completely empty as nothign 
    //is selected and its misleading to have the widgets on there.
    hideAll();

    // These two are present, but un-expanded by default:
    Widget.setExpanded(ontologicalMetadata, false);
    Widget.setExpanded(mKeywords, false);

    setMinimumSize(new Dimension(300, 500)); // if WidgetStack overrides getMinimumSize w/out checking for a set, this won't work.
}