private void buildExternalsPanel() { FormBuilder builder = FormBuilder.create().layout(new FormLayout("fill:pref:grow", "p")); int row = 1; for (ExternalFileEntry efe : externals) { builder.add(efe.getPanel()).xy(1, row); builder.appendRows("2dlu, p"); row += 2; } builder.add(Box.createVerticalGlue()).xy(1, row); builder.appendRows("2dlu, p, 2dlu, p"); builder.add(addExtPan).xy(1, row + 2); builder.add(Box.createVerticalGlue()).xy(1, row + 2); // builder.getPanel().setBorder(BorderFactory.createMatteBorder(1,1,1,1,Color.green)); // externalFilesPanel.setBorder(BorderFactory.createMatteBorder(1,1,1,1,Color.red)); JScrollPane pane = new JScrollPane(builder.getPanel()); pane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); externalFilesPanel.setMinimumSize(new Dimension(400, 400)); externalFilesPanel.setPreferredSize(new Dimension(400, 400)); externalFilesPanel.removeAll(); externalFilesPanel.add(pane, BorderLayout.CENTER); externalFilesPanel.revalidate(); externalFilesPanel.repaint(); }
// Center given button in a box, centered vertically and 6 pixels on left and right private Box createBoxForButton(JButton button) { Box buttonRow = Box.createHorizontalBox(); buttonRow.add(Box.createHorizontalStrut(6)); buttonRow.add(button); buttonRow.add(Box.createHorizontalStrut(6)); Box buttonBox = Box.createVerticalBox(); buttonBox.add(Box.createVerticalGlue()); buttonBox.add(buttonRow); buttonBox.add(Box.createVerticalGlue()); return buttonBox; }
/** OptionPaneDemo Constructor */ public OptionPaneDemo(SwingSet2 swingset) { // Set the title for this demo, and an icon used to represent this // demo inside the SwingSet2 app. super(swingset, "OptionPaneDemo", "toolbar/JOptionPane.gif"); JPanel demo = getDemoPanel(); demo.setLayout(new BoxLayout(demo, BoxLayout.X_AXIS)); JPanel bp = new JPanel() { public Dimension getMaximumSize() { return new Dimension(getPreferredSize().width, super.getMaximumSize().height); } }; bp.setLayout(new BoxLayout(bp, BoxLayout.Y_AXIS)); bp.add(Box.createRigidArea(VGAP30)); bp.add(Box.createRigidArea(VGAP30)); bp.add(createInputDialogButton()); bp.add(Box.createRigidArea(VGAP15)); bp.add(createWarningDialogButton()); bp.add(Box.createRigidArea(VGAP15)); bp.add(createMessageDialogButton()); bp.add(Box.createRigidArea(VGAP15)); bp.add(createComponentDialogButton()); bp.add(Box.createRigidArea(VGAP15)); bp.add(createConfirmDialogButton()); bp.add(Box.createVerticalGlue()); demo.add(Box.createHorizontalGlue()); demo.add(bp); demo.add(Box.createHorizontalGlue()); }
public HelpUI(Frame parent, String title) { sidebar = new Sidebar(); sidebar.setBorder(new EmptyBorder(10, 10, 10, 10)); infoView = new JTextPane(); Dimension d1 = sidebar.getPreferredSize(); infoView.setPreferredSize(new Dimension(d1.width * 3, d1.height - 5)); infoView.setEditable(false); MouseAdapter ma = new MouseAdapter() { @Override public void mouseClicked(MouseEvent me) { SidebarOption sopt = (SidebarOption) me.getComponent(); if (sel != null) { sel.setSelected(false); sel.repaint(); } sel = sopt; sel.setSelected(true); sel.repaint(); renderInfo(); } }; general = new SidebarOption("General Info", HELP_GENERAL_LOC); general.addMouseListener(ma); sidebar.add(general); sidebar.add(Box.createVerticalStrut(scy(10))); artifact = new SidebarOption("Artifacts", HELP_ARTIFACTS_LOC); artifact.addMouseListener(ma); sidebar.add(artifact); sidebar.add(Box.createVerticalStrut(scy(10))); net = new SidebarOption("Networking", HELP_NET_LOC); net.addMouseListener(ma); sidebar.add(net); sidebar.add(Box.createVerticalStrut(scy(10))); gpl = new SidebarOption("License", HELP_GPL_LOC); gpl.addMouseListener(ma); sidebar.add(gpl); general.setSelected(true); sel = general; sidebar.add(Box.createVerticalGlue()); add(BorderLayout.WEST, sidebar); add(BorderLayout.CENTER, new JScrollPane(infoView)); setResizable(false); pack(); setLocationRelativeTo(parent); setTitle(title); renderInfo(); }
public void createFileChooserDemo() { theImage = new JLabel(""); jpgIcon = createImageIcon("filechooser/jpgIcon.jpg", "jpg image"); gifIcon = createImageIcon("filechooser/gifIcon.gif", "gif image"); JPanel demoPanel = getDemoPanel(); demoPanel.setLayout(new BoxLayout(demoPanel, BoxLayout.Y_AXIS)); JPanel innerPanel = new JPanel(); innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.X_AXIS)); demoPanel.add(Box.createRigidArea(VGAP20)); demoPanel.add(innerPanel); demoPanel.add(Box.createRigidArea(VGAP20)); innerPanel.add(Box.createRigidArea(HGAP20)); // Create a panel to hold buttons JPanel buttonPanel = new JPanel() { public Dimension getMaximumSize() { return new Dimension(getPreferredSize().width, super.getMaximumSize().height); } }; buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS)); buttonPanel.add(Box.createRigidArea(VGAP15)); buttonPanel.add(createPlainFileChooserButton()); buttonPanel.add(Box.createRigidArea(VGAP15)); buttonPanel.add(createPreviewFileChooserButton()); buttonPanel.add(Box.createRigidArea(VGAP15)); buttonPanel.add(createCustomFileChooserButton()); buttonPanel.add(Box.createVerticalGlue()); // Create a panel to hold the image JPanel imagePanel = new JPanel(); imagePanel.setLayout(new BorderLayout()); imagePanel.setBorder(new BevelBorder(BevelBorder.LOWERED)); JScrollPane scroller = new JScrollPane(theImage); scroller.getVerticalScrollBar().setUnitIncrement(10); scroller.getHorizontalScrollBar().setUnitIncrement(10); imagePanel.add(scroller, BorderLayout.CENTER); // add buttons and image panels to inner panel innerPanel.add(buttonPanel); innerPanel.add(Box.createRigidArea(HGAP30)); innerPanel.add(imagePanel); innerPanel.add(Box.createRigidArea(HGAP20)); }
protected boolean _addButtonExit_() { String strMethod = "_addButtonExit_()"; add(Box.createHorizontalGlue()); add(Box.createVerticalGlue()); if (this._btnExit_ == null) { MySystem.s_printOutError(this, strMethod, "nil this._btnExit"); return false; } add(this._btnExit_); // this._addSeparator_(); return true; }
public MainPanel() { super(new BorderLayout()); l1.setToolTipText("Test1"); l2.setToolTipText("Test2"); l3.setToolTipText("<html><img src='" + url + "'>Test3</html>"); JPanel p1 = new JPanel(new BorderLayout()); p1.setBorder(BorderFactory.createTitledBorder("javax.swing.Timer")); p1.add(l1); JPanel p2 = new JPanel(new BorderLayout()); p2.setBorder(BorderFactory.createTitledBorder("Animated Gif")); p2.add(l2, BorderLayout.NORTH); p2.add(l3, BorderLayout.SOUTH); Box box = Box.createVerticalBox(); box.add(p1); box.add(Box.createVerticalStrut(20)); box.add(p2); box.add(Box.createVerticalGlue()); add(box); setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); setPreferredSize(new Dimension(320, 240)); }
public MainPanel() { super(new BorderLayout()); setSilderUI(slider1); setSilderUI(slider2); Box box1 = Box.createHorizontalBox(); box1.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); box1.add(new JSlider(SwingConstants.VERTICAL, 0, 1000, 100)); box1.add(Box.createHorizontalStrut(20)); box1.add(slider1); box1.add(Box.createHorizontalGlue()); Box box2 = Box.createVerticalBox(); box2.setBorder(BorderFactory.createEmptyBorder(20, 0, 20, 20)); box2.add(makeTitledPanel("Default", new JSlider(0, 1000, 100))); box2.add(Box.createVerticalStrut(20)); box2.add(makeTitledPanel("Jump to clicked position", slider2)); box2.add(Box.createVerticalGlue()); add(box1, BorderLayout.WEST); add(box2); // setBorder(BorderFactory.createEmptyBorder(5, 20, 5, 10)); setPreferredSize(new Dimension(320, 240)); }
public class ListPanel extends JPanel { private java.util.List<JPanel> rows = new ArrayList<>(); private java.util.List<Component> struts = new ArrayList<>(); private Gui gui; private Component puff = Box.createVerticalGlue(); public ListPanel(Gui gui) { this.gui = gui; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(puff); } public void addRow(Component... components) { remove(puff); final JPanel row = new JPanel(); row.addMouseListener( new MouseAdapter() { @Override public void mouseClicked(MouseEvent event) { gui.notifyObserver("/use " + rows.indexOf(event.getSource())); } }); row.setLayout(new BoxLayout(row, BoxLayout.X_AXIS)); // row.add(Box.createHorizontalStrut(3)); row.setMinimumSize(new Dimension(10, 30)); row.setMaximumSize(new Dimension(250, 30)); for (Component component : components) { row.add(component); } JButton red = new JButton("x"); red.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent event) { int deleted = rows.indexOf(row); gui.notifyObserver("/use " + deleted); gui.notifyObserver("/disconnect"); } }); red.setBackground(Color.PINK.darker()); red.setForeground(Color.WHITE); row.add(Box.createHorizontalGlue()); row.add(red); rows.add(row); Component strut = Box.createVerticalStrut(5); struts.add(strut); add(row); add(strut); add(puff); repaint(); updateUI(); } public void removeRow(int index) { remove(rows.get(index)); remove(struts.get(index)); rows.remove(index); struts.remove(index); repaint(); updateUI(); } public void selectRow(int index) { int count = 0; for (JPanel row : rows) { if (count % 2 == 0) { row.setBackground(new Color(200, 200, 230)); } else { row.setBackground(new Color(240, 240, 240)); } ++count; } if (index != -1) { rows.get(index).setBackground(new Color(170, 250, 170)); } repaint(); updateUI(); } }
public WizardStep getStage(String stage) { final WhatsNew _this = this; WizardStep ws = new WizardStep(); int ind = stage.indexOf(":"); Version v = new Version(stage.substring(0, ind)); int lind = Integer.parseInt(stage.substring(ind + 1)); java.util.List<WhatsNewItem> its = this.items.get(v); if (its == null) { return null; } WhatsNewItem item = its.get(lind); if (item == null) { return null; } ws.title = item.title; ws.helpText = this.getFirstHelpText(); if ((item.description != null) || (item.component != null)) { final Box b = new Box(BoxLayout.Y_AXIS); if (item.description != null) { JTextPane hp = UIUtils.createHelpTextPane(item.description, this.projectViewer); hp.setBorder(null); hp.setSize(new Dimension(UIUtils.getPopupWidth() - 25, 500)); Box hpb = new Box(BoxLayout.Y_AXIS); hpb.add(hp); hpb.setMaximumSize(hpb.getPreferredSize()); hpb.setBorder(UIUtils.createPadding(0, 5, 0, 0)); b.add(hpb); } if (item.component != null) { if (item.description != null) { b.add(Box.createVerticalStrut(5)); } item.component.setAlignmentY(Component.TOP_ALIGNMENT); item.component.setBorder(UIUtils.createPadding(5, 10, 0, 0)); b.add(item.component); } b.add(Box.createVerticalGlue()); ws.panel = b; } return ws; }
public SketchProperties(Editor e, Sketch s) { super(); editor = e; sketch = s; fields = new HashMap<String, JComponent>(); this.setPreferredSize(new Dimension(500, 400)); this.setMinimumSize(new Dimension(500, 400)); this.setMaximumSize(new Dimension(500, 400)); this.setSize(new Dimension(500, 400)); Point eLoc = editor.getLocation(); int x = eLoc.x; int y = eLoc.y; Dimension eSize = editor.getSize(); int w = eSize.width; int h = eSize.height; int cx = x + (w / 2); int cy = y + (h / 2); this.setLocation(new Point(cx - 250, cy - 200)); this.setModal(true); outer = new JPanel(new BorderLayout()); outer.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.add(outer); win = new JPanel(); win.setLayout(new BorderLayout()); outer.add(win, BorderLayout.CENTER); buttonBar = new JPanel(new FlowLayout(FlowLayout.RIGHT)); saveButton = new JButton("OK"); saveButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { save(); SketchProperties.this.dispose(); } }); cancelButton = new JButton("Cancel"); cancelButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { SketchProperties.this.dispose(); } }); buttonBar.add(saveButton); buttonBar.add(cancelButton); win.add(buttonBar, BorderLayout.SOUTH); tabs = new JTabbedPane(); overviewPane = new JPanel(); overviewPane.setLayout(new BoxLayout(overviewPane, BoxLayout.PAGE_AXIS)); overviewPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); addTextField(overviewPane, "author", "Sketch author:"); addTextArea(overviewPane, "summary", "Summary:"); addTextArea(overviewPane, "license", "Copyright / License:"); tabs.add("Overview", overviewPane); objectsPane = new JPanel(); objectsPane.setLayout(new BoxLayout(objectsPane, BoxLayout.PAGE_AXIS)); objectsPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); addTextField(objectsPane, "board", "Board:"); addTextField(objectsPane, "core", "Core:"); addTextField(objectsPane, "compiler", "Compiler:"); addTextField(objectsPane, "port", "Serial port:"); addTextField(objectsPane, "programmer", "Programmer:"); JButton setDef = new JButton("Set to current IDE values"); setDef.setMaximumSize(setDef.getPreferredSize()); setDef.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { setObjectValues(); } }); objectsPane.add(Box.createVerticalGlue()); objectsPane.add(setDef); tabs.add("Objects", objectsPane); win.add(tabs, BorderLayout.CENTER); this.setTitle("Sketch Properties"); this.pack(); this.setVisible(true); }
/** make the box view */ protected void makeContents() { _view.add(makeDefaultFolderNavigationButton()); _view.add(Box.createVerticalGlue()); }
public ThumbMaker() { super("ThumbMaker"); // grab the preferences so that they can be used to fill out the layout ThumbMakerPreferences myPrefs = ThumbMakerPreferences.getInstance(); // content pane JPanel pane = new JPanel(); pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS)); setContentPane(pane); // top panel JPanel top = new JPanel(); top.setLayout(new BoxLayout(top, BoxLayout.X_AXIS)); pane.add(top); // left-hand panel JPanel left = new JPanel(); left.setLayout(new BoxLayout(left, BoxLayout.Y_AXIS)); top.add(left); // horizontal padding top.add(Box.createHorizontalStrut(5)); // label for file list JLabel listLabel = GUIUtil.makeLabel("Files to process:"); listLabel.setDisplayedMnemonic('f'); String listTip = "List of files from which to create thumbnails"; listLabel.setToolTipText(listTip); left.add(GUIUtil.pad(listLabel)); // list of files to convert list = new JList(); listLabel.setLabelFor(list); list.setToolTipText(listTip); list.setModel(new DefaultListModel()); list.setDragEnabled(true); changeFilesInList = new ThumbTransferHandler(); list.setTransferHandler(changeFilesInList); left.add(new JScrollPane(list)); // progress bar progress = new JProgressBar(0, 1); progress.setString("[Drag and drop files onto list to begin]"); progress.setStringPainted(true); progress.setToolTipText("Status of thumbnail processing operation"); left.add(progress); // panel for process and remove buttons JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); // add files button addFiles = new JButton("Add Files"); addFiles.setMnemonic('d'); addFiles.setToolTipText("Add files to be processed."); addFiles.addActionListener(this); p.add(addFiles); p.add(Box.createHorizontalStrut(5)); // process button process = new JButton("Process"); process.setMnemonic('p'); process.setToolTipText("Begin creating thumbnails"); process.addActionListener(this); p.add(process); p.add(Box.createHorizontalStrut(5)); // remove button remove = new JButton("Remove"); remove.setMnemonic('v'); remove.setToolTipText("Remove selected files from the list"); remove.addActionListener(this); p.add(remove); left.add(GUIUtil.pad(p)); // right-hand panel JPanel right = new JPanel(); right.setLayout(new BoxLayout(right, BoxLayout.Y_AXIS)); top.add(right); // panel for resolution settings p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); // resolution label JLabel resLabel = GUIUtil.makeLabel("Resolution: "); resLabel.setDisplayedMnemonic('s'); resLabel.setToolTipText("Resolution of the thumbnails"); p.add(resLabel); // x resolution text box xres = GUIUtil.makeTextField(myPrefs.getStringPref(ThumbMakerPreferences.RES_WIDTH_PREF_NAME), 2); resLabel.setLabelFor(xres); xres.setToolTipText("Thumbnail width"); p.add(xres); // "by" label JLabel byLabel = GUIUtil.makeLabel(" by "); byLabel.setDisplayedMnemonic('y'); p.add(byLabel); // y resolution text box yres = GUIUtil.makeTextField(myPrefs.getStringPref(ThumbMakerPreferences.RES_HEIGHT_PREF_NAME), 2); byLabel.setLabelFor(yres); yres.setToolTipText("Thumbnail height"); p.add(yres); right.add(GUIUtil.pad(p)); right.add(Box.createVerticalStrut(8)); // aspect ratio checkbox aspect = new JCheckBox("Maintain aspect ratio", true); aspect.setMnemonic('m'); aspect.setToolTipText( "When checked, thumbnails are not stretched, " + "but rather padded with the background color."); aspect.addActionListener(this); right.add(GUIUtil.pad(aspect)); // make sure that the check box is initialized correctly aspect.setSelected( myPrefs .getStringPref(ThumbMakerPreferences.DO_MAINTAIN_ASPECT_PREF_NAME) .equalsIgnoreCase(ThumbMakerPreferences.BOOLEAN_TRUE_STRING)); // panel for background color p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); // load the color values from the preferences int redValueNumber = myPrefs.getIntegerPref(ThumbMakerPreferences.RED_VALUE_PREF_NAME); int greenValueNumber = myPrefs.getIntegerPref(ThumbMakerPreferences.GREEN_VALUE_PREF_NAME); int blueValueNumber = myPrefs.getIntegerPref(ThumbMakerPreferences.BLUE_VALUE_PREF_NAME); // background color label colorLabel = GUIUtil.makeLabel("Background color: "); String colorTip = "Thumbnail background color"; colorLabel.setToolTipText(colorTip); p.add(colorLabel); // background color colorBox = new JPanel(); colorBox.setToolTipText(colorTip); colorBox.setBorder(new LineBorder(Color.black, 1)); Dimension colorBoxSize = new Dimension(45, 15); colorBox.setMaximumSize(colorBoxSize); colorBox.setMinimumSize(colorBoxSize); colorBox.setPreferredSize(colorBoxSize); colorBox.setBackground(new Color(redValueNumber, greenValueNumber, blueValueNumber)); p.add(colorBox); right.add(GUIUtil.pad(p)); right.add(Box.createVerticalStrut(2)); // red slider redLabel = GUIUtil.makeLabel("R"); red = new JSlider(0, 255, redValueNumber); redValue = GUIUtil.makeLabel("" + redValueNumber); redValue.setToolTipText("Red color component slider"); right.add(makeSlider(redLabel, red, redValue, "Red")); // green slider greenLabel = GUIUtil.makeLabel("G"); green = new JSlider(0, 255, greenValueNumber); greenValue = GUIUtil.makeLabel("" + greenValueNumber); greenValue.setToolTipText("Green color component slider"); right.add(makeSlider(greenLabel, green, greenValue, "Green")); // blue slider blueLabel = GUIUtil.makeLabel("B"); blue = new JSlider(0, 255, blueValueNumber); blueValue = GUIUtil.makeLabel("" + blueValueNumber); right.add(makeSlider(blueLabel, blue, blueValue, "Blue")); right.add(Box.createVerticalStrut(8)); // panel for algorithm p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); // algorithm label JLabel algorithmLabel = GUIUtil.makeLabel("Algorithm: "); algorithmLabel.setDisplayedMnemonic('l'); String algorithmTip = "Resizing algorithm to use"; algorithmLabel.setToolTipText(algorithmTip); p.add(algorithmLabel); // algorithm combo box algorithm = GUIUtil.makeComboBox( new String[] {"Smooth", "Standard", "Fast", "Replicate", "Area averaging"}); algorithmLabel.setLabelFor(algorithm); algorithm.setToolTipText(algorithmTip); p.add(algorithm); // set the algorithm value from the preferences algorithm.setSelectedIndex(myPrefs.getIntegerPref(ThumbMakerPreferences.RESIZE_ALG_PREF_NAME)); right.add(GUIUtil.pad(p)); // panel for output format p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); // format label JLabel formatLabel = GUIUtil.makeLabel("Format: "); formatLabel.setDisplayedMnemonic('f'); String formatTip = "Thumbnail output format"; formatLabel.setToolTipText(formatTip); p.add(formatLabel); // format combo box format = GUIUtil.makeComboBox(new String[] {"PNG", "JPG"}); formatLabel.setLabelFor(format); format.setToolTipText(formatTip); p.add(format); // set the format value from the preferences format.setSelectedIndex(myPrefs.getIntegerPref(ThumbMakerPreferences.THUMB_FORMAT_PREF_NAME)); right.add(GUIUtil.pad(p)); right.add(Box.createVerticalStrut(5)); // panel for prepend string p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); // prepend label JLabel prependLabel = GUIUtil.makeLabel("Prepend: "); prependLabel.setDisplayedMnemonic('e'); String prependTip = "Starting string for each thumbnail filename"; prependLabel.setToolTipText(prependTip); p.add(prependLabel); // prepend field prepend = GUIUtil.makeTextField( myPrefs.getStringPref(ThumbMakerPreferences.STRING_TO_PREPEND_PREF_NAME), 4); prependLabel.setLabelFor(prepend); prepend.setToolTipText(prependTip); p.add(prepend); p.add(Box.createHorizontalStrut(5)); // append label JLabel appendLabel = GUIUtil.makeLabel("Append: "); appendLabel.setDisplayedMnemonic('a'); String appendTip = "Ending string for each thumbnail filename"; appendLabel.setToolTipText(appendTip); p.add(appendLabel); // append field append = GUIUtil.makeTextField( myPrefs.getStringPref(ThumbMakerPreferences.STRING_TO_APPEND_PREF_NAME), 4); appendLabel.setLabelFor(append); append.setToolTipText(appendTip); p.add(append); right.add(GUIUtil.pad(p)); // vertical padding right.add(Box.createVerticalGlue()); // bottom panel JPanel bottom = new JPanel(); bottom.setLayout(new BoxLayout(bottom, BoxLayout.X_AXIS)); pane.add(bottom); // output folder label JLabel outputLabel = GUIUtil.makeLabel("Output folder: "); outputLabel.setDisplayedMnemonic('o'); String outputTip = "Thumbnail output folder"; outputLabel.setToolTipText(outputTip); bottom.add(outputLabel); // output folder field String filePath = new File(myPrefs.getStringPref(ThumbMakerPreferences.FILE_PATH_STRING_PREF_NAME)) .getAbsolutePath(); output = GUIUtil.makeTextField(filePath, 8); outputLabel.setLabelFor(output); output.setToolTipText(outputTip); // start this in default and then lock down so "..." is used output.setEditable(false); output.setBackground(Color.LIGHT_GRAY); bottom.add(output); // add a file chooser button "..." dotDotDot = new JButton("..."); dotDotDot.setMnemonic('.'); dotDotDot.setToolTipText("Select destination directory."); dotDotDot.addActionListener(this); bottom.add(dotDotDot); right.add(GUIUtil.pad(p)); setFromPreferences(); addWindowListener(this); }
/** Construct a new panel. */ public JUnixPanel(ConfigApp app) { super(app, "Linux Paths:"); /* initialize UI components */ { pHomeDirComp = new JAbsoluteDirComp("Home Directory", sSize); add(pHomeDirComp); add(Box.createRigidArea(new Dimension(0, 20))); pTempDirComp = new JAbsoluteDirComp("Temporary Directory", sSize); add(pTempDirComp); add(Box.createRigidArea(new Dimension(0, 20))); pJavaHomeDirComp = new JAbsoluteDirComp("Java Home Directory", sSize); add(pJavaHomeDirComp); add(Box.createRigidArea(new Dimension(0, 40))); pJavadocDirComp = new JAbsoluteDirComp("Local Vendor Javadoc Directory", sSize); add(pJavadocDirComp); add(Box.createRigidArea(new Dimension(0, 20))); pExtraJavaLibsComp = new JAbsoluteJarsComp("Local Java Libraries", sSize); add(pExtraJavaLibsComp); add(Box.createRigidArea(new Dimension(0, 20))); add(Box.createVerticalGlue()); pNotesDialog.setMessage( "Linux Parameters:", "The Home Directory is the absolute path to the parent directory of all user " + "home directories. Usually this directory resides on a network file system and " + "may not be (/home) at your site.\n" + "\n" + "The Temporary Directory is absolute path to the directory used to write various " + "temporary files generated by Pipeline programs. For optimal performance, this " + "directory should reside on a local file system.\n" + "\n" + "The Java Home Directory is the path to the root directory of the local Java " + "Runtime Environment (JRE) installed on Linux artist workstations used to run " + "Pipeline client programs. By default, this is set to the JRE used to run this " + "configuration tool and the Pipeline server daemons in the Java Runtime section " + "above. If you wish to use a different JRE for workstation clients than is used " + "for the server daemons, you can specify the location of the alternative JRE " + "here.\n" + "\n" + "The Local Vendor Javadoc Directory is the path to the root directory where the " + "documentation generated by javadoc for locally created Pipeline plugins and " + "standalone utils is located. Providing this will allow users to easily access " + "the documentation for locally created plugins from Pipeline's user interface.\n" + "\n" + "The Local Java Libraries is a optional set of JAR files containing common Java " + "class shared by a large number of locally created plugins and/or standalone " + "utils. Any JARs provided will be added to the Java classpath for all Pipeline " + "programs. This is typically used for relatively large 3rd party libraries for " + "things such as XML parsing or SQL database connections which would otherwise " + "need to be embedded in many different plugin JARs. Since these libraries " + "be dynamically updated (like plugins can), they are not suitable for anything " + "which might need to modified without a Pipeline shutdown. This feature is " + "only an optimization to reduce plugin size and memory footprint but is not " + "required in order to use 3rd party Java libraries with Pipeline."); } }