use of javax.swing.JToggleButton in project vcell by virtualcell.
the class VFrap_OverlayEditorPanelJAI method getFillButton.
public JToggleButton getFillButton() {
if (fillButton == null) {
fillButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/fill.gif")));
fillButton.setPreferredSize(new Dimension(32, 32));
fillButton.setMargin(new Insets(2, 2, 2, 2));
fillButton.setToolTipText("Fill");
}
return fillButton;
}
use of javax.swing.JToggleButton in project vcell by virtualcell.
the class VFrap_OverlayEditorPanelJAI method getRightPanel.
private JPanel getRightPanel() {
if (rightPanel == null) {
// this is added to the right side of the editor panel with all the buttons in two columns.
rightPanel = new JPanel();
final GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.rowHeights = new int[] { 0, 0, 7, 7, 7, 0, 7 };
rightPanel.setLayout(gridBagLayout);
GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
gridBagConstraints1.gridx = 0;
gridBagConstraints1.gridy = 0;
rightPanel.add(getZoomInButton(), gridBagConstraints1);
GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
if (// buttons in one column
!isEditable) {
gridBagConstraints2.gridx = 0;
gridBagConstraints2.gridy = 1;
} else // display in two columns
{
gridBagConstraints2.gridx = 1;
gridBagConstraints2.gridy = 0;
}
rightPanel.add(getZoomOutButton(), gridBagConstraints2);
final GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
if (// buttons in one column
!isEditable) {
gridBagConstraints3.gridy = 2;
gridBagConstraints3.gridx = 0;
} else // display in two columns
{
gridBagConstraints3.gridy = 1;
gridBagConstraints3.gridx = 0;
}
rightPanel.add(getContrastButtonPlus(), gridBagConstraints3);
final GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
if (// buttons in one column
!isEditable) {
gridBagConstraints4.gridy = 3;
gridBagConstraints4.gridx = 0;
} else // display in two columns
{
gridBagConstraints4.gridy = 1;
gridBagConstraints4.gridx = 1;
}
rightPanel.add(getContrastButtonMinus(), gridBagConstraints4);
/*
*NOTE: display type will not be applied to other buttons so far.
*The reason is only 4 buttons are visible in the image panel in main frame.
*We want one column display for the four buttons in main frame.
*If anyone wants one column display for all the buttons, please change following buttons accordingly.
*/
final GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
gridBagConstraints5.gridy = 2;
gridBagConstraints5.gridx = 0;
gridBagConstraints5.insets = new Insets(12, 0, 12, 0);
rightPanel.add(getCropButton(), gridBagConstraints5);
final GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
gridBagConstraints6.gridy = 2;
gridBagConstraints6.gridx = 1;
gridBagConstraints6.insets = new Insets(12, 0, 12, 0);
rightPanel.add(getAutoCropButton(), gridBagConstraints6);
final GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
gridBagConstraints7.gridy = 3;
gridBagConstraints7.gridx = 0;
rightPanel.add(getPaintButton(), gridBagConstraints7);
final GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
gridBagConstraints8.gridy = 4;
gridBagConstraints8.gridx = 0;
rightPanel.add(getEraseButton(), gridBagConstraints8);
brushToolHelper = new BrushToolHelper(new JToggleButton[] { paintButton, eraseButton }, 10, null);
getImagePane().addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
super.mouseEntered(e);
brushToolHelper.hidePopup();
}
});
final GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
gridBagConstraints9.gridy = 5;
gridBagConstraints9.gridx = 0;
rightPanel.add(getFillButton(), gridBagConstraints9);
final GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
gridBagConstraints10.gridy = 3;
gridBagConstraints10.gridx = 1;
rightPanel.add(getImportROIMaskButton(), gridBagConstraints10);
final GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
gridBagConstraints11.gridy = 4;
gridBagConstraints11.gridx = 1;
rightPanel.add(getClearROIbutton(), gridBagConstraints11);
final GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
gridBagConstraints12.gridy = 5;
gridBagConstraints12.gridx = 1;
rightPanel.add(getRoiTimePlotButton(), gridBagConstraints12);
}
return rightPanel;
}
use of javax.swing.JToggleButton in project vcell by virtualcell.
the class VFrap_OverlayEditorPanelJAI method getCropButton.
public JToggleButton getCropButton() {
if (cropButton == null) {
cropButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/crop.gif")));
cropButton.setPreferredSize(new Dimension(32, 32));
cropButton.setMargin(new Insets(2, 2, 2, 2));
cropButton.setToolTipText("Crop");
}
return cropButton;
}
use of javax.swing.JToggleButton in project vcell by virtualcell.
the class OverlayEditorPanelJAI method getToolButtonPanel.
private JPanel getToolButtonPanel() {
if (toolButtonPanel == null) {
GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
gridBagConstraints3.insets = new Insets(0, 0, 5, 0);
gridBagConstraints3.gridy = 1;
gridBagConstraints3.ipady = 0;
gridBagConstraints3.ipadx = 0;
gridBagConstraints3.gridx = 1;
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.insets = new Insets(0, 0, 5, 5);
gridBagConstraints.gridx = 0;
gridBagConstraints.ipady = 0;
gridBagConstraints.gridy = 1;
GridBagConstraints gridBagConstraintsUndo = new GridBagConstraints();
gridBagConstraintsUndo.insets = new Insets(0, 0, 5, 5);
gridBagConstraintsUndo.gridy = 0;
gridBagConstraintsUndo.ipady = 0;
gridBagConstraintsUndo.ipadx = 0;
gridBagConstraintsUndo.gridx = 0;
toolButtonPanel = new JPanel();
final GridBagLayout gbl_toolButtonPanel = new GridBagLayout();
gbl_toolButtonPanel.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0 };
toolButtonPanel.setLayout(gbl_toolButtonPanel);
toolButtonPanel.add(getUndoButton(), gridBagConstraintsUndo);
borderToolButton = new JButton(new ImageIcon(getClass().getResource("/images/addBorder.gif")));
borderToolButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
firePropertyChange(FRAP_DATA_PAD_PROPERTY, null, null);
}
});
selectButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/geSelect.gif")));
selectButton.setToolTipText("Disitnct domain region pick tool");
selectButton.setPreferredSize(new Dimension(32, 32));
selectButton.setMinimumSize(new Dimension(32, 32));
selectButton.setMaximumSize(new Dimension(32, 32));
GridBagConstraints gbc_selectButton = new GridBagConstraints();
gbc_selectButton.insets = new Insets(0, 0, 5, 0);
gbc_selectButton.gridx = 1;
gbc_selectButton.gridy = 0;
toolButtonPanel.add(selectButton, gbc_selectButton);
borderToolButton.setToolTipText("Add/Crop borders or Resize dataset");
borderToolButton.setMinimumSize(new Dimension(32, 32));
borderToolButton.setMaximumSize(new Dimension(32, 32));
borderToolButton.setPreferredSize(new Dimension(32, 32));
GridBagConstraints gbc_borderToolButton = new GridBagConstraints();
gbc_borderToolButton.insets = new Insets(10, 0, 0, 5);
gbc_borderToolButton.gridx = 0;
gbc_borderToolButton.gridy = 6;
toolButtonPanel.add(borderToolButton, gbc_borderToolButton);
toolButtonPanel.add(getZoomInButton(), gridBagConstraints);
toolButtonPanel.add(getZoomOutButton(), gridBagConstraints3);
contrastButtonPlus = new JButton(new ImageIcon(getClass().getResource("/images/contrastUp.gif")));
contrastButtonPlus.setName("contrastPlusBtn");
contrastButtonPlus.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
imagePane.increaseContrast();
updateLabel(-1, -1);
}
});
contrastButtonPlus.setPreferredSize(new Dimension(32, 32));
contrastButtonPlus.setMinimumSize(new Dimension(32, 32));
contrastButtonPlus.setMaximumSize(new Dimension(32, 32));
contrastButtonPlus.setMargin(new Insets(2, 2, 2, 2));
contrastButtonPlus.setToolTipText("Increase Contrast");
final GridBagConstraints gridBagConstraints_4 = new GridBagConstraints();
gridBagConstraints_4.insets = new Insets(0, 0, 5, 5);
gridBagConstraints_4.gridy = 2;
gridBagConstraints_4.gridx = 0;
toolButtonPanel.add(contrastButtonPlus, gridBagConstraints_4);
contrastButtonMinus = new JButton(new ImageIcon(getClass().getResource("/images/contrastDown.gif")));
contrastButtonMinus.setName("contrastMinusBtn");
contrastButtonMinus.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
imagePane.decreaseContrast();
updateLabel(-1, -1);
}
});
contrastButtonMinus.setPreferredSize(new Dimension(32, 32));
contrastButtonMinus.setMinimumSize(new Dimension(32, 32));
contrastButtonMinus.setMaximumSize(new Dimension(32, 32));
contrastButtonMinus.setMargin(new Insets(2, 2, 2, 2));
contrastButtonMinus.setToolTipText("Decrease Contrast");
final GridBagConstraints gridBagConstraints_6 = new GridBagConstraints();
gridBagConstraints_6.insets = new Insets(0, 0, 5, 0);
gridBagConstraints_6.gridy = 2;
gridBagConstraints_6.gridx = 1;
toolButtonPanel.add(contrastButtonMinus, gridBagConstraints_6);
cropButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/crop.gif")));
cropButton.setName("roiCropBtn");
cropButton.setPreferredSize(new Dimension(32, 32));
cropButton.setMinimumSize(new Dimension(32, 32));
cropButton.setMaximumSize(new Dimension(32, 32));
cropButton.setMargin(new Insets(2, 2, 2, 2));
cropButton.setToolTipText("Crop");
final GridBagConstraints gridBagConstraints_5 = new GridBagConstraints();
gridBagConstraints_5.insets = new Insets(10, 0, 5, 5);
gridBagConstraints_5.gridy = 3;
gridBagConstraints_5.gridx = 0;
toolButtonPanel.add(cropButton, gridBagConstraints_5);
autoCropButton.setPreferredSize(new Dimension(32, 32));
autoCropButton.setMinimumSize(new Dimension(32, 32));
autoCropButton.setMaximumSize(new Dimension(32, 32));
autoCropButton.setMargin(new Insets(2, 2, 2, 2));
autoCropButton.setToolTipText("Auto Crop");
final GridBagConstraints gridBagConstraints_7 = new GridBagConstraints();
gridBagConstraints_7.insets = new Insets(10, 0, 5, 0);
gridBagConstraints_7.gridy = 3;
gridBagConstraints_7.gridx = 1;
toolButtonPanel.add(autoCropButton, gridBagConstraints_7);
paintButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/paint.gif")));
paintButton.setName("roiPaintBtn");
paintButton.setSelected(true);
paintButton.setPreferredSize(new Dimension(32, 32));
paintButton.setMinimumSize(new Dimension(32, 32));
paintButton.setMaximumSize(new Dimension(32, 32));
paintButton.setPreferredSize(new Dimension(32, 32));
paintButton.setMinimumSize(new Dimension(32, 32));
paintButton.setMaximumSize(new Dimension(32, 32));
paintButton.setMargin(new Insets(2, 2, 2, 2));
paintButton.setToolTipText("Paint, rt-clk menu");
final GridBagConstraints gridBagConstraints_1 = new GridBagConstraints();
gridBagConstraints_1.insets = new Insets(0, 0, 5, 5);
gridBagConstraints_1.gridy = 4;
gridBagConstraints_1.gridx = 0;
toolButtonPanel.add(paintButton, gridBagConstraints_1);
eraseButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/eraser.gif")));
eraseButton.setName("roiEraseBtn");
eraseButton.setPreferredSize(new Dimension(32, 32));
eraseButton.setMinimumSize(new Dimension(32, 32));
eraseButton.setMaximumSize(new Dimension(32, 32));
eraseButton.setPreferredSize(new Dimension(32, 32));
eraseButton.setMinimumSize(new Dimension(32, 32));
eraseButton.setMaximumSize(new Dimension(32, 32));
eraseButton.setMargin(new Insets(2, 2, 2, 2));
eraseButton.setToolTipText("Erase, rt-clk menu");
final GridBagConstraints gridBagConstraints_2 = new GridBagConstraints();
gridBagConstraints_2.insets = new Insets(0, 0, 5, 0);
gridBagConstraints_2.gridy = 4;
gridBagConstraints_2.gridx = 1;
toolButtonPanel.add(eraseButton, gridBagConstraints_2);
brushToolHelper = new BrushToolHelper(new JToggleButton[] { paintButton, eraseButton }, 10, new BrushToolHelper.CursorChanger() {
@Override
public void changeCursors() {
OverlayEditorPanelJAI.this.changeCursor();
}
});
getImagePane().addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
super.mouseEntered(e);
brushToolHelper.hidePopup();
}
});
fillButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/fill.gif")));
fillButton.setName("roiFillBtn");
fillButton.setPreferredSize(new Dimension(32, 32));
fillButton.setMinimumSize(new Dimension(32, 32));
fillButton.setMaximumSize(new Dimension(32, 32));
fillButton.setPreferredSize(new Dimension(32, 32));
fillButton.setMinimumSize(new Dimension(32, 32));
fillButton.setMaximumSize(new Dimension(32, 32));
fillButton.setMargin(new Insets(2, 2, 2, 2));
fillButton.setToolTipText("Fill");
final GridBagConstraints gridBagConstraints_3 = new GridBagConstraints();
gridBagConstraints_3.insets = new Insets(0, 0, 5, 5);
gridBagConstraints_3.gridy = 5;
gridBagConstraints_3.gridx = 0;
toolButtonPanel.add(fillButton, gridBagConstraints_3);
clearROIbutton.setPreferredSize(new Dimension(32, 32));
clearROIbutton.setMinimumSize(new Dimension(32, 32));
clearROIbutton.setMaximumSize(new Dimension(32, 32));
clearROIbutton.setPreferredSize(new Dimension(32, 32));
clearROIbutton.setMinimumSize(new Dimension(32, 32));
clearROIbutton.setMaximumSize(new Dimension(32, 32));
clearROIbutton.setMargin(new Insets(2, 2, 2, 2));
clearROIbutton.setToolTipText("Clear Domain");
final GridBagConstraints gridBagConstraints_9 = new GridBagConstraints();
gridBagConstraints_9.insets = new Insets(0, 0, 5, 0);
gridBagConstraints_9.gridy = 5;
gridBagConstraints_9.gridx = 1;
toolButtonPanel.add(clearROIbutton, gridBagConstraints_9);
extrudeToolButton = new JButton(new ImageIcon(getClass().getResource("/images/extrude.gif")));
extrudeToolButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
firePropertyChange(FRAP_DATA_DUPLICATE_PROPERTY, null, null);
}
});
extrudeToolButton.setToolTipText("Extrude 2D to 3D");
extrudeToolButton.setPreferredSize(new Dimension(32, 32));
extrudeToolButton.setMinimumSize(new Dimension(32, 32));
extrudeToolButton.setMaximumSize(new Dimension(32, 32));
GridBagConstraints gbc_extrudeToolButton = new GridBagConstraints();
gbc_extrudeToolButton.insets = new Insets(10, 0, 0, 0);
gbc_extrudeToolButton.gridx = 1;
gbc_extrudeToolButton.gridy = 6;
toolButtonPanel.add(extrudeToolButton, gbc_extrudeToolButton);
}
return toolButtonPanel;
}
Aggregations