List of usage examples for javax.swing BorderFactory createTitledBorder
public static TitledBorder createTitledBorder(Border border, String title)
From source file:controletanquesproj1.FrameInicial.java
/** * Creates new form FrameInicial// w w w .j a va2 s . com */ public FrameInicial() { initComponents(); jLabel_4v.setEnabled(false); jSpinner_4v.setEnabled(false); jLabel_SetPoint.setEnabled(true); jSpinner_0a30.setEnabled(true); jLabel_Am_mi.setEnabled(false); jSpinner_Am_mi.setEnabled(false); jLabel_Du_ma.setEnabled(false); jSpinner_Du_ma.setEnabled(false); jLabel_Du_mi.setEnabled(false); jSpinner_Du_mi.setEnabled(false); jLabel_Offset.setEnabled(false); jSpinner_Offset.setEnabled(false); jLabel_Periodo.setEnabled(false); jSpinner_Periodo.setEnabled(false); jCBPlotP0.setVisible(false); jCBPlotP1.setVisible(false); jCBPlotErro_T1.setVisible(false); jCBPlotAcaoP_T1.setVisible(false); jCBPlotAcaoI_T1.setVisible(false); jCBPlotAcaoD_T1.setVisible(false); jCBPlotSP_T2.setVisible(false); jCBPlotMV_T2.setVisible(false); jCBPlotErro_T2.setVisible(false); jCBPlotAcaoP_T2.setVisible(false); jCBPlotAcaoI_T2.setVisible(false); jCBPlotAcaoD_T2.setVisible(false); jPanelGrafico.setLayout(new java.awt.BorderLayout()); demo = new Grafico(); itensDeGraficoV.add(new ItemDeGrafico("MV_T1", sizePlot)); itensDeGraficoV.add(new ItemDeGrafico("MVSat", sizePlot)); itensDeGraficoCm.add(new ItemDeGrafico("SetPoint_T1", sizePlot)); vetorDeItensDeGrafico = new ArrayList[2]; vetorDeItensDeGrafico[0] = itensDeGraficoV; vetorDeItensDeGrafico[1] = itensDeGraficoCm; demo.createDatasets(vetorDeItensDeGrafico); //Inconsistencia //dataset = demo.createDataset(itensDeGrafico); JFreeChart chart = demo.createChart(); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(1000, 660)); setPanel(chartPanel); for (int i = 0; i < 8; i++) { jCBoxCanalSaida.addItem(i); } jCBoxTanque1.addItem(0); jCBoxTanque1.addItem(1); jCBoxTanque2.addItem(0); jCBoxTanque2.addItem(1); jCBoxTanque2.setSelectedItem(1); jCBoxTanqueSelected.addItem(1); jCBoxTanqueSelected.addItem(2); jCBoxTanqueSelected.setSelectedItem(2); Border lineBorder = BorderFactory.createLineBorder(Color.black); Border titledBorder = BorderFactory.createTitledBorder(lineBorder, "Tanque 1"); jPanel_PlotT1.setBorder(titledBorder); Border titledBorder2 = BorderFactory.createTitledBorder(lineBorder, "Tanque 2"); jPanel_PlotT2.setBorder(titledBorder2); //System.out.println("Thread Grafico = " + Thread.currentThread().getId()); }
From source file:com.net2plan.gui.utils.onlineSimulationPane.OnlineSimulationPane.java
public OnlineSimulationPane(IVisualizationCallback mainWindow) { super();// w ww . j a v a 2s. c o m this.mainWindow = mainWindow; simKernel = new SimKernel(); simKernel.setGUIListener(this); File ALGORITHMS_DIRECTORY = new File( IGUIModule.CURRENT_DIR + SystemUtils.getDirectorySeparator() + "workspace"); ALGORITHMS_DIRECTORY = ALGORITHMS_DIRECTORY.isDirectory() ? ALGORITHMS_DIRECTORY : IGUIModule.CURRENT_DIR; eventGeneratorPanel = new RunnableSelector(SimKernel.getEventGeneratorLabel(), "File", simKernel.getEventGeneratorClass(), ALGORITHMS_DIRECTORY, new ParameterValueDescriptionPanel()); eventProcessorPanel = new RunnableSelector(SimKernel.getEventProcessorLabel(), "File", simKernel.getEventProcessorClass(), ALGORITHMS_DIRECTORY, new ParameterValueDescriptionPanel()); simulationConfigurationPanel = new ParameterValueDescriptionPanel(); simulationConfigurationPanel.setParameters(simKernel.getSimulationParameters()); JTabbedPane configPane = new JTabbedPane(); configPane.addTab(SimKernel.getEventGeneratorLabel(), eventGeneratorPanel); configPane.addTab(SimKernel.getEventProcessorLabel(), eventProcessorPanel); JPanel topPane = new JPanel(new MigLayout("insets 0 0 0 0", "[][grow][]", "[][grow]")); topPane.add(new JLabel("Simulation parameters"), "spanx 3, wrap"); topPane.add(simulationConfigurationPanel, "spanx 3, grow, wrap"); splitPaneConfiguration = new JSplitPane(JSplitPane.VERTICAL_SPLIT); splitPaneConfiguration.setTopComponent(topPane); splitPaneConfiguration.setBottomComponent(configPane); splitPaneConfiguration.setResizeWeight(0.5); splitPaneConfiguration.addPropertyChangeListener(new ProportionalResizeJSplitPaneListener()); splitPaneConfiguration .setBorder(BorderFactory.createTitledBorder(new LineBorder(Color.BLACK), "Simulation execution")); JPanel pan_execution = new JPanel(new MigLayout("fill, insets 0 0 0 0")); pan_execution.add(splitPaneConfiguration, "grow"); btn_updateReport = new JButton("Update"); btn_updateReport.setToolTipText("Update the simulation report"); btn_updateReport.addActionListener(this); simReport = new JPanel(); simReport.setLayout(new BorderLayout()); simReport.add(btn_updateReport, BorderLayout.NORTH); addTab("Simulation input parameters", pan_execution); simulationControlPanel = configureSimulationControlPanel(); addTab("Simulation control", simulationControlPanel); addTab("Simulation report", simReport); simReportTab = 2; simKernel.reset(); if (mainWindow.getDesign() != null) simKernel.setNetPlan(mainWindow.getDesign()); }
From source file:bazaar4idea.ui.BzrPushDialog.java
/** Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * @noinspection ALL/*w w w. j ava 2 s. c o m*/ */ private void $$$setupUI$$$() { contentPanel = new JPanel(); contentPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); final JPanel panel1 = new JPanel(); panel1.setLayout(new GridLayoutManager(5, 1, new Insets(0, 0, 0, 0), -1, -1)); contentPanel.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final Spacer spacer1 = new Spacer(); panel1.add(spacer1, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); final JLabel label1 = new JLabel(); label1.setText("Destination Repository URL:"); label1.setDisplayedMnemonic('D'); label1.setDisplayedMnemonicIndex(0); panel1.add(label1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); repositoryTxt = new JTextField(); panel1.add(repositoryTxt, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JPanel panel2 = new JPanel(); panel2.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1)); panel1.add(panel2, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, new Dimension(-1, 100), null, null, 0, false)); panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Options")); revisionCbx = new JCheckBox(); revisionCbx.setText("Revision"); revisionCbx.setMnemonic('R'); revisionCbx.setDisplayedMnemonicIndex(0); panel2.add(revisionCbx, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); revisionTxt = new JTextField(); revisionTxt.setEnabled(false); revisionTxt.setText("tip"); panel2.add(revisionTxt, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final Spacer spacer2 = new Spacer(); panel2.add(spacer2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); final Spacer spacer3 = new Spacer(); panel2.add(spacer3, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); hgRepositorySelectorComponent = new BzrRepositorySelectorComponent(); panel1.add(hgRepositorySelectorComponent.$$$getRootComponent$$$(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); label1.setLabelFor(repositoryTxt); }
From source file:net.minelord.gui.panes.IRCPane.java
public IRCPane() { super();/*from w w w. java 2 s . co m*/ this.setBorder(new EmptyBorder(5, 5, 5, 5)); this.setLayout(null); nickSelectPane = new JPanel(); nickSelectPane.setLayout(null); nickSelectPane.setBounds(325, 70, 200, 200); TitledBorder title = BorderFactory .createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Pick a nick"); title.setTitleJustification(TitledBorder.RIGHT); nickSelectPane.setBorder(title); nickSelect = new JTextField(); final JButton done = new JButton("Done"); nickSelect.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent arg0) { } @Override public void keyReleased(KeyEvent arg0) { String nick = nickSelect.getText(); boolean success = true; if (nick.length() > 0) { if (nick.substring(0, 1).matches("[0-9]") || nick.charAt(0) == '-' || nick.contains(" ")) success = false; } else success = false; if (success) IRCPane.nick = nick; done.setEnabled(success); } @Override public void keyPressed(KeyEvent arg0) { if (arg0.getKeyCode() == 10) done.doClick(); } }); nickSelect.setBounds(50, 65, 100, 30); done.setBounds(50, 125, 100, 30); done.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { remove(nickSelectPane); repaint(); startClient(nickSelect.getText()); } }); done.setEnabled(false); nickSelectPane.add(nickSelect); nickSelectPane.add(done); add(nickSelectPane); addFocusListener(new FocusListener() { @Override public void focusLost(FocusEvent paramFocusEvent) { } @Override public void focusGained(FocusEvent paramFocusEvent) { if (nickSelectPane.getParent() != null) nickSelect.requestFocus(); if (input != null && input.getParent() != null) input.requestFocus(); } }); instance = this; }
From source file:com.floreantpos.bo.ui.explorer.MenuItemExplorer.java
private JPanel buildSearchForm() { JPanel panel = new JPanel(); panel.setLayout(new MigLayout("", "[][]15[][]15[][]15[]", "[]5[]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ JLabel lblOrderType = new JLabel(Messages.getString("MenuItemExplorer.4")); //$NON-NLS-1$ cbOrderTypes = new JComboBox(); cbOrderTypes.addItem(Messages.getString("MenuItemExplorer.5")); //$NON-NLS-1$ cbOrderTypes.addItem("<None>"); List<OrderType> orderTypes = Application.getInstance().getOrderTypes(); for (OrderType orderType : orderTypes) { cbOrderTypes.addItem(orderType); }/*from w w w. jav a 2 s .co m*/ JLabel lblName = new JLabel(Messages.getString("MenuItemExplorer.0")); //$NON-NLS-1$ JLabel lblGroup = new JLabel(Messages.getString("MenuItemExplorer.1")); //$NON-NLS-1$ tfName = new JTextField(15); try { List<MenuGroup> menuGroupList = MenuGroupDAO.getInstance().findAll(); cbGroup = new JComboBox(); cbGroup.addItem(Messages.getString("MenuItemExplorer.2")); //$NON-NLS-1$ cbGroup.addItem("<None>"); for (MenuGroup s : menuGroupList) { cbGroup.addItem(s); } JButton searchBttn = new JButton(Messages.getString("MenuItemExplorer.3")); //$NON-NLS-1$ panel.add(lblName, "align label"); //$NON-NLS-1$ panel.add(tfName); panel.add(lblGroup); panel.add(cbGroup); panel.add(lblOrderType); panel.add(cbOrderTypes); panel.add(searchBttn); Border loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); TitledBorder title = BorderFactory.createTitledBorder(loweredetched, "Search"); //$NON-NLS-1$ title.setTitleJustification(TitledBorder.LEFT); panel.setBorder(title); searchBttn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { searchItem(); } }); tfName.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { searchItem(); } }); } catch (Throwable x) { BOMessageDialog.showError(POSConstants.ERROR_MESSAGE, x); } return panel; }
From source file:src.gui.LifelinePanel.java
/** * this method created and set the graph for showing the timing diagram based * on the variable diagram//from www . ja v a 2s .c o m */ public void buildLifeLine() { //1. get type and context String dtype = diagram.getChildText("type"); String context = diagram.getChildText("context"); //the frame and lifeline nodes Element frame = diagram.getChild("frame"); String durationStr = frame.getChildText("duration"); lifelineName = ""; String objectClassName = ""; String yAxisName = ""; float lastIntervalDuration = 0; //condition lifeline if (dtype.equals("condition")) { //check if the context is a action if (context.equals("action")) { //get action/operator Element operatorRef = diagram.getChild("action"); Element operator = null; try { XPath path = new JDOMXPath( "elements/classes/class[@id='" + operatorRef.getAttributeValue("class") + "']/operators/operator[@id='" + operatorRef.getAttributeValue("id") + "']"); operator = (Element) path.selectSingleNode(project); } catch (JaxenException e2) { e2.printStackTrace(); } if (operator != null) { // System.out.println(operator.getChildText("name")); //System.out.println("Life line id "+ lifeline.getAttributeValue("id")); //get the object (can be a parametr. literal, or object) Element objRef = lifeline.getChild("object"); Element attrRef = lifeline.getChild("attribute"); //get object class Element objClass = null; try { XPath path = new JDOMXPath( "elements/classes/class[@id='" + objRef.getAttributeValue("class") + "']"); objClass = (Element) path.selectSingleNode(project); } catch (JaxenException e2) { e2.printStackTrace(); } Element attribute = null; try { XPath path = new JDOMXPath( "elements/classes/class[@id='" + attrRef.getAttributeValue("class") + "']/attributes/attribute[@id='" + attrRef.getAttributeValue("id") + "']"); attribute = (Element) path.selectSingleNode(project); } catch (JaxenException e2) { e2.printStackTrace(); } yAxisName = attribute.getChildText("name"); //if (objClass!=null) Element object = null; //check what is this object (parameterof an action, object, literal) if (objRef.getAttributeValue("element").equals("parameter")) { //get parameter in the action try { XPath path = new JDOMXPath( "parameters/parameter[@id='" + objRef.getAttributeValue("id") + "']"); object = (Element) path.selectSingleNode(operator); } catch (JaxenException e2) { e2.printStackTrace(); } String parameterStr = object.getChildText("name"); lifelineName = parameterStr + ":" + objClass.getChildText("name"); objectClassName = parameterStr + ":" + objClass.getChildText("name"); } // //set suround border Border etchedBdr = BorderFactory.createEtchedBorder(); Border titledBdr = BorderFactory.createTitledBorder(etchedBdr, "lifeline(" + lifelineName + ")"); //Border titledBdr = BorderFactory.createTitledBorder(etchedBdr, ""); Border emptyBdr = BorderFactory.createEmptyBorder(10, 10, 10, 10); Border compoundBdr = BorderFactory.createCompoundBorder(titledBdr, emptyBdr); this.setBorder(compoundBdr); //Boolean attribute if (attribute.getChildText("type").equals("1")) { lifelineName += " - " + attribute.getChildText("name"); Element timeIntervals = lifeline.getChild("timeIntervals"); XYSeriesCollection dataset = new XYSeriesCollection(); XYSeries series = new XYSeries("Boolean"); for (Iterator<Element> it1 = timeIntervals.getChildren().iterator(); it1.hasNext();) { Element timeInterval = it1.next(); boolean insertPoint = true; Element durationConstratint = timeInterval.getChild("durationConstratint"); Element lowerbound = durationConstratint.getChild("lowerbound"); Element upperbound = durationConstratint.getChild("upperbound"); Element value = timeInterval.getChild("value"); //Add for both lower and upper bound //lower bound float lowerTimePoint = 0; try { lowerTimePoint = Float.parseFloat(lowerbound.getAttributeValue("value")); lastIntervalDuration = lowerTimePoint; } catch (Exception e) { insertPoint = false; } //System.out.println(" > point x= "+ Float.toString(lowerTimePoint)+ " , y= "+ lowerbound.getAttributeValue("value")); if (insertPoint) { series.add(lowerTimePoint, (value.getText().equals("false") ? 0 : 1)); } //upper bound float upperTimePoint = 0; try { upperTimePoint = Float.parseFloat(upperbound.getAttributeValue("value")); lastIntervalDuration = upperTimePoint; } catch (Exception e) { insertPoint = false; } //System.out.println(" > point x= "+ Float.toString(upperTimePoint)+ " , y= "+ lowerbound.getAttributeValue("value")); if (insertPoint && upperTimePoint != lowerTimePoint) { series.add(upperTimePoint, (value.getText().equals("false") ? 0 : 1)); } } dataset.addSeries(series); //chart = ChartFactory.createXYStepChart(lifelineName, "time", "value", dataset, PlotOrientation.VERTICAL, false, true, false); chart = ChartFactory.createXYStepChart(attribute.getChildText("name"), "time", "value", dataset, PlotOrientation.VERTICAL, false, true, false); chart.setBackgroundPaint(Color.WHITE); XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); NumberAxis domainAxis = new NumberAxis("Time"); domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); domainAxis.setAutoRangeIncludesZero(false); //set timing ruler if (durationStr.trim().equals("")) { if (lastIntervalDuration > 0) domainAxis.setUpperBound(lastIntervalDuration + timingRulerAdditional); else domainAxis.setUpperBound(10.0); } else { try { float dur = Float.parseFloat(durationStr); if (dur >= lastIntervalDuration) { domainAxis.setUpperBound(dur + timingRulerAdditional); } else { domainAxis.setUpperBound(lastIntervalDuration + timingRulerAdditional); } } catch (Exception e) { if (lastIntervalDuration > 0) domainAxis.setUpperBound(lastIntervalDuration + timingRulerAdditional); else domainAxis.setUpperBound(10.0); } } plot.setDomainAxis(domainAxis); String[] values = { "false", "true" }; //SymbolAxis rangeAxis = new SymbolAxis("Values", values); SymbolAxis rangeAxis = new SymbolAxis(yAxisName, values); plot.setRangeAxis(rangeAxis); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new Dimension(chartPanel.getSize().width, 175)); JLabel title = new JLabel("<html><b><u>" + objectClassName + "</u></b></html>"); title.setBackground(Color.WHITE); this.add(title, BorderLayout.WEST); this.add(chartPanel, BorderLayout.CENTER); } } } //if this is a possible sequence of action being modeled to a condition else if (context.equals("general")) { } } else if (dtype.equals("state")) { } }
From source file:ch.zhaw.simulation.diagram.charteditor.DefaultPlotEditor.java
/** * Standard constructor - constructs a panel for editing the properties of * the specified plot./*from www . j ava2 s . c om*/ * <P> * In designing the panel, we need to be aware that subclasses of Plot will * need to implement subclasses of PlotPropertyEditPanel - so we need to * leave one or two 'slots' where the subclasses can extend the user * interface. * * @param plot * the plot, which should be changed. */ public DefaultPlotEditor(Plot plot) { this.plotInsets = plot.getInsets(); this.backgroundPaintSample = new PaintSample(plot.getBackgroundPaint()); this.outlineStrokeSample = new StrokeSample(plot.getOutlineStroke()); this.outlinePaintSample = new PaintSample(plot.getOutlinePaint()); // Disabled because makes no sense for us // if (plot instanceof CategoryPlot) { // this.plotOrientation = ((CategoryPlot) plot).getOrientation(); // } else if (plot instanceof XYPlot) { // this.plotOrientation = ((XYPlot) plot).getOrientation(); // } if (plot instanceof CategoryPlot) { CategoryItemRenderer renderer = ((CategoryPlot) plot).getRenderer(); if (renderer instanceof LineAndShapeRenderer) { LineAndShapeRenderer r = (LineAndShapeRenderer) renderer; this.drawLines = BooleanUtilities.valueOf(r.getBaseLinesVisible()); this.drawShapes = BooleanUtilities.valueOf(r.getBaseShapesVisible()); } } else if (plot instanceof XYPlot) { XYItemRenderer renderer = ((XYPlot) plot).getRenderer(); if (renderer instanceof StandardXYItemRenderer) { StandardXYItemRenderer r = (StandardXYItemRenderer) renderer; this.drawLines = BooleanUtilities.valueOf(r.getPlotLines()); this.drawShapes = BooleanUtilities.valueOf(r.getBaseShapesVisible()); } } setLayout(new BorderLayout()); this.availableStrokeSamples = new StrokeSample[4]; this.availableStrokeSamples[0] = new StrokeSample(null); this.availableStrokeSamples[1] = new StrokeSample(new BasicStroke(1.0f)); this.availableStrokeSamples[2] = new StrokeSample(new BasicStroke(2.0f)); this.availableStrokeSamples[3] = new StrokeSample(new BasicStroke(3.0f)); // create a panel for the settings... JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), plot.getPlotType() + localizationResources.getString(":"))); JPanel general = new JPanel(new BorderLayout()); general.setBorder(BorderFactory.createTitledBorder(localizationResources.getString("General"))); JPanel interior = new JPanel(new LCBLayout(7)); interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); interior.add(new JLabel(localizationResources.getString("Outline_stroke"))); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (StrokeSample s : this.availableStrokeSamples) { model.addElement(s.getStroke()); } this.cbOutlineStroke = new JComboBox(model); this.cbOutlineStroke.setSelectedItem(this.outlineStrokeSample.getStroke()); this.cbOutlineStroke.setRenderer(new StrokeComboboxRenderer()); interior.add(this.cbOutlineStroke); interior.add(new JLabel()); interior.add(new JLabel(localizationResources.getString("Outline_Paint"))); JButton button = new JButton(localizationResources.getString("Select...")); button.setActionCommand("OutlinePaint"); button.addActionListener(this); interior.add(this.outlinePaintSample); interior.add(button); interior.add(new JLabel(localizationResources.getString("Background_paint"))); button = new JButton(localizationResources.getString("Select...")); button.setActionCommand("BackgroundPaint"); button.addActionListener(this); interior.add(this.backgroundPaintSample); interior.add(button); // Disabled because makes no sense for us // if (this.plotOrientation != null) { // boolean isVertical = // this.plotOrientation.equals(PlotOrientation.VERTICAL); // int index = isVertical ? ORIENTATION_VERTICAL : // ORIENTATION_HORIZONTAL; // interior.add(new // JLabel(localizationResources.getString("Orientation"))); // this.orientationCombo = new JComboBox(orientationNames); // this.orientationCombo.setSelectedIndex(index); // this.orientationCombo.setActionCommand("Orientation"); // this.orientationCombo.addActionListener(this); // interior.add(this.orientationCombo); // interior.add(new JPanel()); // } if (this.drawLines != null) { interior.add(new JLabel(localizationResources.getString("Draw_lines"))); this.drawLinesCheckBox = new JCheckBox(); this.drawLinesCheckBox.setSelected(this.drawLines.booleanValue()); this.drawLinesCheckBox.setActionCommand("DrawLines"); this.drawLinesCheckBox.addActionListener(this); interior.add(new JPanel()); interior.add(this.drawLinesCheckBox); } if (this.drawShapes != null) { interior.add(new JLabel(localizationResources.getString("Draw_shapes"))); this.drawShapesCheckBox = new JCheckBox(); this.drawShapesCheckBox.setSelected(this.drawShapes.booleanValue()); this.drawShapesCheckBox.setActionCommand("DrawShapes"); this.drawShapesCheckBox.addActionListener(this); interior.add(new JPanel()); interior.add(this.drawShapesCheckBox); } general.add(interior, BorderLayout.NORTH); JPanel appearance = new JPanel(new BorderLayout()); appearance.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); appearance.add(general, BorderLayout.NORTH); JTabbedPane tabs = new JTabbedPane(); tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); Axis domainAxis = null; if (plot instanceof CategoryPlot) { domainAxis = ((CategoryPlot) plot).getDomainAxis(); } else if (plot instanceof XYPlot) { domainAxis = ((XYPlot) plot).getDomainAxis(); } this.domainAxisPropertyPanel = DefaultAxisEditor.getInstance(domainAxis); if (this.domainAxisPropertyPanel != null) { this.domainAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); tabs.add(localizationResources.getString("Domain_Axis"), this.domainAxisPropertyPanel); } Axis rangeAxis = null; if (plot instanceof CategoryPlot) { rangeAxis = ((CategoryPlot) plot).getRangeAxis(); } else if (plot instanceof XYPlot) { rangeAxis = ((XYPlot) plot).getRangeAxis(); } this.rangeAxisPropertyPanel = DefaultAxisEditor.getInstance(rangeAxis); if (this.rangeAxisPropertyPanel != null) { this.rangeAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); tabs.add(localizationResources.getString("Range_Axis"), this.rangeAxisPropertyPanel); } tabs.add(localizationResources.getString("Appearance"), appearance); panel.add(tabs); add(panel); }
From source file:gda.gui.mca.McaGUI.java
private JPanel getAdcPanel() { gainLabel = new JLabel("Gain"); offsetLabel = new JLabel("Offset"); lldLabel = new JLabel("LLD"); gainField = new JTextField(10); gainField.addActionListener(new ActionListener() { @Override/* ww w . ja va2 s. co m*/ public void actionPerformed(ActionEvent e) { setAdcValues(); } }); offsetField = new JTextField(10); offsetField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setAdcValues(); } }); lldField = new JTextField(10); lldField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setAdcValues(); } }); adcPanel = new JPanel(); adcPanel.setLayout(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); gc.gridx = GridBagConstraints.RELATIVE; gc.gridy = 0; adcPanel.add(gainLabel, gc); adcPanel.add(gainField, gc); gc.gridx = 0; gc.gridy = GridBagConstraints.RELATIVE; adcPanel.add(offsetLabel, gc); gc.gridx = GridBagConstraints.RELATIVE; gc.gridy = 1; adcPanel.add(offsetField, gc); gc.gridx = 0; gc.gridy = 2; adcPanel.add(lldLabel, gc); gc.gridx = GridBagConstraints.RELATIVE; adcPanel.add(lldField, gc); adcPanel.setBorder(BorderFactory.createTitledBorder(new EtchedBorder(), "ADC")); return adcPanel; }
From source file:net.minelord.gui.panes.IRCPane.java
public void disconnect() { status = "Disconnecting..."; TitledBorder title = BorderFactory .createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), status); title.setTitleJustification(TitledBorder.RIGHT); if (userScroller != null) userScroller.setBorder(title);//from ww w . j ava 2 s . co m else scroller.setBorder(title); input.setEnabled(false); }
From source file:net.sf.xmm.moviemanager.gui.DialogIMDbMultiAdd.java
JPanel createFileLocationPanel() { // Panel file location JPanel fileLocationPanel = new JPanel(); fileLocationPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), " Movie parts "), BorderFactory.createEmptyBorder(0, 3, 3, 3))); fileLocationPanel.setLayout(new BorderLayout()); fileLocation = new JTextArea(); fileLocation.setEditable(false);//from w w w . jav a2s. c o m JScrollPane fileLocaScroll = new JScrollPane(fileLocation); fileLocationPanel.add(fileLocaScroll, BorderLayout.CENTER); fileLocation.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { //handleFileLocationPopup(e); } }); return fileLocationPanel; }