public PercentagePanel (final ScaledNumericValue value, String chartTitle, String name, String description) { super(value, name, description); this.value = value; initializeComponents(chartTitle); chart.setValues(value.getTimeline(), value.getScaling()); expandButton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent event) { chart.setExpanded(!chart.isExpanded()); boolean expanded = chart.isExpanded(); GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout(); GridBagConstraints chartConstraints = layout.getConstraints(chart); GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton); if (expanded) { chart.setPreferredSize(new Dimension(150, 200)); expandButton.setText("-"); chartConstraints.weightx = 1; expandButtonConstraints.weightx = 0; } else { chart.setPreferredSize(new Dimension(150, 62)); expandButton.setText("+"); chartConstraints.weightx = 0; expandButtonConstraints.weightx = 1; } layout.setConstraints(chart, chartConstraints); layout.setConstraints(expandButton, expandButtonConstraints); chart.revalidate(); } }); }
public PercentagePanel (final ScaledNumericValue value, String chartTitle, String name, String description) { super(value, name, description); this.value = value; initializeComponents(chartTitle); chart.setValues(value.getTimeline(), value.getScaling()); expandButton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent event) { chart.setExpanded(!chart.isExpanded()); boolean expanded = chart.isExpanded(); GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout(); GridBagConstraints chartConstraints = layout.getConstraints(chart); GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton); if (expanded) { chart.setPreferredSize(new Dimension(150, 200)); expandButton.setText("-"); chartConstraints.weightx = 1; expandButtonConstraints.weightx = 0; } else { chart.setPreferredSize(new Dimension(150, 62)); expandButton.setText("+"); chartConstraints.weightx = 0; expandButtonConstraints.weightx = 1; } layout.setConstraints(chart, chartConstraints); layout.setConstraints(expandButton, expandButtonConstraints); chart.revalidate(); } }); }
highMinSlider.setValue(value.getHighMin()); highMaxSlider.setValue(value.getHighMax()); chart.setValues(value.getTimeline(), value.getScaling()); relativeCheckBox.setSelected(value.isRelative()); if (hasIndependent)
highMinSlider.setValue(value.getHighMin()); highMaxSlider.setValue(value.getHighMax()); chart.setValues(value.getTimeline(), value.getScaling()); relativeCheckBox.setSelected(value.isRelative()); if (hasIndependent)
public PercentagePanel (final ScaledNumericValue value, String chartTitle, String name, String description) { super(value, name, description); this.value = value; initializeComponents(chartTitle); chart.setValues(value.getTimeline(), value.getScaling()); expandButton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent event) { chart.setExpanded(!chart.isExpanded()); boolean expanded = chart.isExpanded(); GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout(); GridBagConstraints chartConstraints = layout.getConstraints(chart); GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton); if (expanded) { chart.setPreferredSize(new Dimension(150, 200)); expandButton.setText("-"); chartConstraints.weightx = 1; expandButtonConstraints.weightx = 0; } else { chart.setPreferredSize(new Dimension(150, 62)); expandButton.setText("+"); chartConstraints.weightx = 0; expandButtonConstraints.weightx = 1; } layout.setConstraints(chart, chartConstraints); layout.setConstraints(expandButton, expandButtonConstraints); chart.revalidate(); } }); }
highMinSlider.setValue(value.getHighMin()); highMaxSlider.setValue(value.getHighMax()); chart.setValues(value.getTimeline(), value.getScaling()); relativeCheckBox.setSelected(value.isRelative()); if (hasIndependent)