use of javax.swing.JToolBar in project vcell by virtualcell.
the class ParameterMappingPanel method initialize.
/**
* Initialize the class.
*/
private void initialize() {
try {
setName("ModelParameterPanel");
setLayout(new java.awt.BorderLayout());
setSize(655, 226);
addButton = new JButton(VCellIcons.addIcon);
deleteButton = new JButton(VCellIcons.deleteIcon);
deleteButton.setEnabled(false);
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.add(addButton);
toolBar.add(deleteButton);
add(getScrollPaneTable().getEnclosingScrollPane(), BorderLayout.CENTER);
add(toolBar, BorderLayout.NORTH);
addButton.addActionListener(ivjEventHandler);
deleteButton.addActionListener(ivjEventHandler);
getScrollPaneTable().getSelectionModel().addListSelectionListener(ivjEventHandler);
initConnections();
getScrollPaneTable().setDefaultRenderer(Double.class, new DefaultScrollTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
setHorizontalAlignment(RIGHT);
return this;
}
});
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
}
use of javax.swing.JToolBar in project vcell by virtualcell.
the class ScrollTable method getPageToolBar.
private JToolBar getPageToolBar() {
if (pageToolBar == null) {
pageLabel = new JLabel();
pageLabel.setBorder(new EmptyBorder(2, 5, 2, 2));
firstPageButton = createToolBarButton(VCellIcons.firstPageIcon);
previousPageButton = createToolBarButton(VCellIcons.previousPageIcon);
nextPageButton = createToolBarButton(VCellIcons.nextPageIcon);
lastPageButton = createToolBarButton(VCellIcons.lastPageIcon);
pageToolBar = new JToolBar();
pageToolBar.setFloatable(false);
pageToolBar.add(Box.createHorizontalGlue());
pageToolBar.add(firstPageButton);
pageToolBar.add(previousPageButton);
pageToolBar.add(pageLabel);
pageToolBar.add(nextPageButton);
pageToolBar.add(lastPageButton);
}
return pageToolBar;
}
use of javax.swing.JToolBar in project vcell by virtualcell.
the class BioModelEditorPathwayDiagramPanel method createToolBar.
private JToolBar createToolBar(int orientation) {
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.setBorder(new javax.swing.border.EtchedBorder());
toolBar.setOrientation(orientation);
for (ActionID id : ActionID.values()) {
ActionBuilder actionBuilder = actionBuilderMap.get(id);
if (actionBuilder != null) {
Action action = actionBuilder.buildAction(this);
if (action != null) {
toolBar.add(createToolBarButton(action));
}
}
}
return toolBar;
}
use of javax.swing.JToolBar in project vcell by virtualcell.
the class BatchRunDetailsPanel method getToolBar.
public JToolBar getToolBar() {
if (toolbar == null) {
toolbar = new JToolBar();
for (int i = 0; i < buttonLabels.length; ++i) {
icons[i] = new ImageIcon(iconFiles[i]);
}
addButton = new JButton(icons[0]);
addButton.setMargin(new Insets(0, 0, 0, 0));
addButton.setToolTipText(buttonLabels[0]);
addButton.setBorderPainted(false);
addButton.addActionListener(this);
deleteButton = new JButton(icons[1]);
deleteButton.setMargin(new Insets(0, 0, 0, 0));
deleteButton.setToolTipText(buttonLabels[1]);
deleteButton.setBorderPainted(false);
deleteButton.addActionListener(this);
delAllButton = new JButton(icons[2]);
delAllButton.setMargin(new Insets(0, 0, 0, 0));
delAllButton.setToolTipText(buttonLabels[2]);
delAllButton.setBorderPainted(false);
delAllButton.addActionListener(this);
toolbar.add(addButton);
toolbar.add(deleteButton);
toolbar.add(delAllButton);
toolbar.setFloatable(false);
}
return toolbar;
}
use of javax.swing.JToolBar in project smile by haifengl.
the class PlotCanvas method initContextMenauAndToolBar.
/**
* Initialize context menu and toolbar.
*/
private void initContextMenauAndToolBar() {
toolbar = new JToolBar();
toolbar.add(new Button(saveAction));
toolbar.add(new Button(printAction));
toolbar.addSeparator();
toolbar.add(new Button(zoomInAction));
toolbar.add(new Button(zoomOutAction));
toolbar.add(new Button(resetAction));
toolbar.addSeparator();
toolbar.add(new Button(enlargePlotAreaAction));
toolbar.add(new Button(shrinkPlotAreaAction));
toolbar.add(new Button(increaseHeightAction));
toolbar.add(new Button(decreaseHeightAction));
toolbar.add(new Button(increaseWidthAction));
toolbar.add(new Button(decreaseWidthAction));
toolbar.addSeparator();
toolbar.add(new Button(propertyAction));
decreaseHeightAction.setEnabled(false);
decreaseWidthAction.setEnabled(false);
//Initialize popup menu.
popup = new JPopupMenu();
popup.add(new JMenuItem(saveAction));
popup.add(new JMenuItem(printAction));
popup.addSeparator();
popup.add(new JMenuItem(zoomInAction));
popup.add(new JMenuItem(zoomOutAction));
popup.add(new JMenuItem(resetAction));
popup.addSeparator();
popup.add(new JMenuItem(enlargePlotAreaAction));
popup.add(new JMenuItem(shrinkPlotAreaAction));
popup.add(new JMenuItem(increaseHeightAction));
popup.add(new JMenuItem(decreaseHeightAction));
popup.add(new JMenuItem(increaseWidthAction));
popup.add(new JMenuItem(decreaseWidthAction));
popup.addSeparator();
popup.add(new JMenuItem(propertyAction));
AncestorListener ancestorListener = new AncestorListener() {
@Override
public void ancestorAdded(AncestorEvent ae) {
boolean inScrollPane = false;
Container parent = getParent();
while (parent != null) {
if (parent instanceof JScrollPane) {
inScrollPane = true;
scrollPane = (JScrollPane) parent;
break;
}
parent = parent.getParent();
}
increaseHeightAction.setEnabled(inScrollPane);
increaseWidthAction.setEnabled(inScrollPane);
}
@Override
public void ancestorRemoved(AncestorEvent ae) {
}
@Override
public void ancestorMoved(AncestorEvent ae) {
}
};
addAncestorListener(ancestorListener);
}
Aggregations