1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
private ChartPanel mGraphePanel = null;
......
private JComboBox mZoomTypeComboBox = new JComboBox();
private JButton mZoomInButton = new JButton();
private JButton mZoomOutButton = new JButton();
private JButton mResetZoomButton = new JButton();
mZoomTypeComboBox.addItem("--Zoom--");
mZoomTypeComboBox.addItem("Horizontal");
mZoomTypeComboBox.addItem("Vertical");
.....
/** Zoom Out de graphe */
private void mZoomOutButton_actionPerformed(ActionEvent e) {
switch (mZoomTypeComboBox.getSelectedIndex()) {
case 0:
mGraphePanel.zoomOutBoth(2, 2);
break;
case 1:
mGraphePanel.zoomOutDomain(2, 2);
break;
case 2:
mGraphePanel.zoomOutRange(2, 2);
break;
}
}
/** Zoom In de graphe */
private void mZoomInButton_actionPerformed(ActionEvent e) {
switch (mZoomTypeComboBox.getSelectedIndex()) {
case 0:
mGraphePanel.zoomInBoth(2, 2);
break;
case 1:
mGraphePanel.zoomInDomain(2, 2);
break;
case 2:
mGraphePanel.zoomInRange(2, 2);
break;
}
}
private void mResetZoomButton_actionPerformed(ActionEvent e) {
mGraphePanel.restoreAutoBounds();
} |
Partager