use of javax.swing.plaf.basic.BasicArrowButton in project mondrian by pentaho.
the class Workbench method initComponents.
/**
* This method is called from within the constructor to
* initialize the form.
*/
private void initComponents() {
desktopPane = new javax.swing.JDesktopPane();
jToolBar1 = new javax.swing.JToolBar();
jToolBar2 = new javax.swing.JToolBar();
toolbarNewPopupMenu = new JPopupMenu();
toolbarNewButton = new javax.swing.JButton();
toolbarOpenButton = new javax.swing.JButton();
toolbarSaveButton = new javax.swing.JButton();
toolbarSaveAsButton = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
toolbarPreferencesButton = new javax.swing.JButton();
requireSchemaCheckboxMenuItem = new javax.swing.JCheckBoxMenuItem();
menuBar = new javax.swing.JMenuBar();
fileMenu = new javax.swing.JMenu();
newMenu = new javax.swing.JMenu();
newSchemaMenuItem = new javax.swing.JMenuItem();
newQueryMenuItem = new javax.swing.JMenuItem();
newJDBCExplorerMenuItem = new javax.swing.JMenuItem();
newSchemaMenuItem2 = new javax.swing.JMenuItem();
newQueryMenuItem2 = new javax.swing.JMenuItem();
newJDBCExplorerMenuItem2 = new javax.swing.JMenuItem();
openMenuItem = new javax.swing.JMenuItem();
preferencesMenuItem = new javax.swing.JMenuItem();
lastUsed1MenuItem = new javax.swing.JMenuItem();
lastUsed2MenuItem = new javax.swing.JMenuItem();
lastUsed3MenuItem = new javax.swing.JMenuItem();
lastUsed4MenuItem = new javax.swing.JMenuItem();
saveMenuItem = new javax.swing.JMenuItem();
saveAsMenuItem = new javax.swing.JMenuItem();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();
jSeparator3 = new javax.swing.JSeparator();
exitMenuItem = new javax.swing.JMenuItem();
windowMenu = new javax.swing.JMenu();
helpMenu = new javax.swing.JMenu();
editMenu = new javax.swing.JMenu();
cutMenuItem = new javax.swing.JMenuItem(new DefaultEditorKit.CutAction());
copyMenuItem = new javax.swing.JMenuItem(new DefaultEditorKit.CopyAction());
pasteMenuItem = new javax.swing.JMenuItem(new DefaultEditorKit.PasteAction());
deleteMenuItem = new javax.swing.JMenuItem(new AbstractAction(getResourceConverter().getString("workbench.menu.delete", "Delete")) {
private static final long serialVersionUID = 1L;
public void actionPerformed(ActionEvent e) {
JInternalFrame jf = desktopPane.getSelectedFrame();
if (jf != null && jf.getContentPane().getComponent(0) instanceof SchemaExplorer) {
SchemaExplorer se = (SchemaExplorer) jf.getContentPane().getComponent(0);
TreePath tpath = se.tree.getSelectionPath();
se.delete(tpath);
}
}
});
aboutMenuItem = new javax.swing.JMenuItem();
toolsMenu = new javax.swing.JMenu();
viewMenu = new javax.swing.JMenu();
viewXmlMenuItem = new javax.swing.JCheckBoxMenuItem();
setTitle(getResourceConverter().getString("workbench.panel.title", "Schema Workbench"));
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent evt) {
storeWorkbenchProperties();
storeDatabaseMeta();
closeAllSchemaFrames(true);
}
});
getContentPane().add(desktopPane, java.awt.BorderLayout.CENTER);
newSchemaMenuItem2.setText(getResourceConverter().getString("workbench.menu.newSchema", "Schema"));
newSchemaMenuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
newSchemaMenuItemActionPerformed(evt);
}
});
newQueryMenuItem2.setText(getResourceConverter().getString("workbench.menu.newQuery", "MDX Query"));
newQueryMenuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
newQueryMenuItemActionPerformed(evt);
}
});
newJDBCExplorerMenuItem2.setText(getResourceConverter().getString("workbench.menu.newJDBC", "JDBC Explorer"));
newJDBCExplorerMenuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
newJDBCExplorerMenuItemActionPerformed(evt);
}
});
toolbarNewPopupMenu.add(newSchemaMenuItem2);
toolbarNewPopupMenu.add(newQueryMenuItem2);
toolbarNewPopupMenu.add(newJDBCExplorerMenuItem2);
jPanel2.setLayout(new java.awt.BorderLayout());
jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel2.setMaximumSize(new java.awt.Dimension(50, 28));
toolbarNewButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(getResourceConverter().getGUIReference("new"))));
toolbarNewButton.setToolTipText(getResourceConverter().getString("workbench.toolbar.new", "New"));
toolbarNewButton.setBorderPainted(false);
toolbarNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
toolbarNewPopupMenu.show(jPanel2, 0, jPanel2.getSize().height);
}
});
jToolBar2.setFloatable(false);
jToolBar2.add(toolbarNewButton);
jPanel2.add(jToolBar2, java.awt.BorderLayout.CENTER);
toolbarNewArrowButton = new BasicArrowButton(SwingConstants.SOUTH);
toolbarNewArrowButton.setToolTipText(getResourceConverter().getString("workbench.toolbar.newArrow", "New"));
toolbarNewArrowButton.setBorderPainted(false);
toolbarNewArrowButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
toolbarNewPopupMenu.show(jPanel2, 0, jPanel2.getSize().height);
}
});
jPanel2.add(toolbarNewArrowButton, java.awt.BorderLayout.EAST);
jToolBar1.add(jPanel2, 0);
toolbarOpenButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(getResourceConverter().getGUIReference("open"))));
toolbarOpenButton.setToolTipText(getResourceConverter().getString("workbench.toolbar.open", "Open"));
toolbarOpenButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
openMenuItemActionPerformed(evt);
}
});
jToolBar1.add(toolbarOpenButton);
toolbarSaveButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(getResourceConverter().getGUIReference("save"))));
toolbarSaveButton.setToolTipText(getResourceConverter().getString("workbench.toolbar.save", "Save"));
toolbarSaveButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
saveMenuItemActionPerformed(evt);
}
});
jToolBar1.add(toolbarSaveButton);
toolbarSaveAsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(getResourceConverter().getGUIReference("saveAs"))));
toolbarSaveAsButton.setToolTipText(getResourceConverter().getString("workbench.toolbar.saveAs", "Save As"));
toolbarSaveAsButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
saveAsMenuItemActionPerformed(evt);
}
});
jToolBar1.add(toolbarSaveAsButton);
jPanel1.setMaximumSize(new java.awt.Dimension(8, 8));
jToolBar1.add(jPanel1);
toolbarPreferencesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(getResourceConverter().getGUIReference("preferences"))));
toolbarPreferencesButton.setToolTipText(getResourceConverter().getString("workbench.toolbar.connection", "Connection"));
toolbarPreferencesButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
connectionButtonActionPerformed(evt);
}
});
jToolBar1.add(toolbarPreferencesButton);
getContentPane().add(jToolBar1, java.awt.BorderLayout.NORTH);
fileMenu.setText(getResourceConverter().getString("workbench.menu.file", "File"));
fileMenu.setMnemonic(KeyEvent.VK_F);
newMenu.setText(getResourceConverter().getString("workbench.menu.new", "New"));
newSchemaMenuItem.setText(getResourceConverter().getString("workbench.menu.newSchema", "Schema"));
newSchemaMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
newSchemaMenuItemActionPerformed(evt);
}
});
newMenu.add(newSchemaMenuItem);
newQueryMenuItem.setText(getResourceConverter().getString("workbench.menu.newQuery", "MDX Query"));
newQueryMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
newQueryMenuItemActionPerformed(evt);
}
});
newMenu.add(newQueryMenuItem);
newJDBCExplorerMenuItem.setText(getResourceConverter().getString("workbench.menu.newJDBC", "JDBC Explorer"));
newJDBCExplorerMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
newJDBCExplorerMenuItemActionPerformed(evt);
}
});
newMenu.add(newJDBCExplorerMenuItem);
fileMenu.add(newMenu);
openMenuItem.setText(getResourceConverter().getString("workbench.menu.open", "Open"));
openMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
openMenuItemActionPerformed(evt);
}
});
fileMenu.add(openMenuItem);
saveMenuItem.setText(getResourceConverter().getString("workbench.menu.save", "Save"));
saveMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
saveMenuItemActionPerformed(evt);
}
});
fileMenu.add(saveMenuItem);
saveAsMenuItem.setText(getResourceConverter().getString("workbench.menu.saveAsDot", "Save As ..."));
saveAsMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
saveAsMenuItemActionPerformed(evt);
}
});
fileMenu.add(saveAsMenuItem);
// add last used
fileMenu.add(jSeparator2);
lastUsed1MenuItem.setText(getWorkbenchProperty("lastUsed1"));
lastUsed1MenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
lastUsed1MenuItemActionPerformed(evt);
}
});
fileMenu.add(lastUsed1MenuItem);
lastUsed2MenuItem.setText(getWorkbenchProperty("lastUsed2"));
lastUsed2MenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
lastUsed2MenuItemActionPerformed(evt);
}
});
fileMenu.add(lastUsed2MenuItem);
lastUsed3MenuItem.setText(getWorkbenchProperty("lastUsed3"));
lastUsed3MenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
lastUsed3MenuItemActionPerformed(evt);
}
});
fileMenu.add(lastUsed3MenuItem);
lastUsed4MenuItem.setText(getWorkbenchProperty("lastUsed4"));
lastUsed4MenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
lastUsed4MenuItemActionPerformed(evt);
}
});
fileMenu.add(lastUsed4MenuItem);
updateLastUsedMenu();
fileMenu.add(jSeparator1);
exitMenuItem.setText(getResourceConverter().getString("workbench.menu.exit", "Exit"));
exitMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
exitMenuItemActionPerformed(evt);
}
});
fileMenu.add(exitMenuItem);
menuBar.add(fileMenu);
editMenu.setText(getResourceConverter().getString("workbench.menu.edit", "Edit"));
editMenu.setMnemonic(KeyEvent.VK_E);
cutMenuItem.setText(getResourceConverter().getString("workbench.menu.cut", "Cut"));
editMenu.add(cutMenuItem);
copyMenuItem.setText(getResourceConverter().getString("workbench.menu.copy", "Copy"));
editMenu.add(copyMenuItem);
pasteMenuItem.setText(getResourceConverter().getString("workbench.menu.paste", "Paste"));
editMenu.add(pasteMenuItem);
editMenu.add(deleteMenuItem);
menuBar.add(editMenu);
viewMenu.setText(getResourceConverter().getString("workbench.menu.view", "View"));
viewMenu.setMnemonic(KeyEvent.VK_V);
viewXmlMenuItem.setText(getResourceConverter().getString("workbench.menu.viewXML", "View XML"));
viewXmlMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
viewXMLMenuItemActionPerformed(evt);
}
});
viewMenu.add(viewXmlMenuItem);
menuBar.add(viewMenu);
toolsMenu.setText(getResourceConverter().getString("workbench.menu.options", "Options"));
toolsMenu.setMnemonic(KeyEvent.VK_O);
preferencesMenuItem.setText(getResourceConverter().getString("workbench.menu.connection", "Connection"));
preferencesMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
connectionButtonActionPerformed(evt);
}
});
toolsMenu.add(preferencesMenuItem);
requireSchemaCheckboxMenuItem.setText(getResourceConverter().getString("workbench.menu.requireSchema", "Require Schema"));
requireSchemaCheckboxMenuItem.setSelected(requireSchema);
requireSchemaCheckboxMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
requireSchemaActionPerformed(e);
}
});
toolsMenu.add(requireSchemaCheckboxMenuItem);
menuBar.add(toolsMenu);
windowMenu.setText(getResourceConverter().getString("workbench.menu.windows", "Windows"));
windowMenu.setMnemonic(KeyEvent.VK_W);
cascadeMenuItem = new javax.swing.JMenuItem();
cascadeMenuItem.setText(getResourceConverter().getString("workbench.menu.cascadeWindows", "Cascade Windows"));
cascadeMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
cascadeMenuItemActionPerformed(evt);
}
});
tileMenuItem = new javax.swing.JMenuItem();
tileMenuItem.setText(getResourceConverter().getString("workbench.menu.tileWindows", "Tile Windows"));
tileMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
tileMenuItemActionPerformed(evt);
}
});
closeAllMenuItem = new javax.swing.JMenuItem();
closeAllMenuItem.setText(getResourceConverter().getString("workbench.menu.closeAll", "Close All"));
closeAllMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
closeAllMenuItemActionPerformed(evt);
}
});
minimizeMenuItem = new javax.swing.JMenuItem();
minimizeMenuItem.setText(getResourceConverter().getString("workbench.menu.minimizeAll", "Minimize All"));
minimizeMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
minimizeMenuItemActionPerformed(evt);
}
});
maximizeMenuItem = new javax.swing.JMenuItem();
maximizeMenuItem.setText(getResourceConverter().getString("workbench.menu.maximizeAll", "Maximize All"));
maximizeMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
maximizeMenuItemActionPerformed(evt);
}
});
menuBar.add(windowMenu);
aboutMenuItem.setText(getResourceConverter().getString("workbench.menu.about", "About"));
aboutMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
aboutMenuItemActionPerformed(evt);
}
});
helpMenu.add(aboutMenuItem);
helpMenu.setText(getResourceConverter().getString("workbench.menu.help", "Help"));
helpMenu.setMnemonic(KeyEvent.VK_H);
menuBar.add(helpMenu);
setJMenuBar(menuBar);
pack();
}
use of javax.swing.plaf.basic.BasicArrowButton in project ExperienceUI by Garnica1999.
the class ExComboBox method createArrowButton.
@Override
protected JButton createArrowButton() {
BasicArrowButton a = new BasicArrowButton(BasicArrowButton.SOUTH, Color.white, Color.white, new Color(204, 204, 204), Color.white);
a.setBorder(BorderFactory.createLineBorder(Color.WHITE, 1));
return a;
}
use of javax.swing.plaf.basic.BasicArrowButton in project PhenomeScape by soulj.
the class ResultsPanel method createTopRow.
private void createTopRow(GridBagConstraints c) {
c.gridy = 0;
c.gridx = 0;
c.gridwidth = 1;
leftButton = new BasicArrowButton(BasicArrowButton.WEST);
leftButton.putClientProperty("JComponent.sizeVariant", "large");
this.add(leftButton, c);
c.gridx = 1;
rightButton = new BasicArrowButton(BasicArrowButton.EAST);
rightButton.putClientProperty("JComponent.sizeVariant", "large");
this.add(rightButton, c);
c.gridwidth = 2;
c.gridx = 2;
exportButton = new JButton("Export Table");
this.add(exportButton, c);
}
Aggregations