List of usage examples for javax.swing.border LineBorder LineBorder
@ConstructorProperties({ "lineColor", "thickness", "roundedCorners" }) public LineBorder(Color color, int thickness, boolean roundedCorners)
From source file:MainClass.java
public static void main(final String args[]) { JFrame frame = new JFrame("Line Borders"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Border roundedBorder = new LineBorder(Color.BLACK, 12, true); JButton roundedButton = new JButton("Rounded 12 Pixel"); roundedButton.setBorder(roundedBorder); Container contentPane = frame.getContentPane(); contentPane.add(roundedButton, BorderLayout.SOUTH); frame.pack();/* w ww . j a va2s . c o m*/ frame.setSize(300, frame.getHeight()); frame.setVisible(true); }
From source file:com.qawaa.gui.PointAnalysisGUI.java
/** * Auto-generated main method to display this JFrame *///from w ww. j av a 2 s .c o m public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { PointAnalysisGUI inst = new PointAnalysisGUI(); inst.setLocationRelativeTo(null); inst.setVisible(true); inst.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JFrame.setDefaultLookAndFeelDecorated(true); FlowLayout flowLayout = new FlowLayout(); flowLayout.setAlignment(FlowLayout.LEFT); flowLayout.setAlignOnBaseline(true); inst.setTitle(PROGRAM_NAME + " [" + PROGRAM_VERSION + "] " + " - " + DefaultMessage.SOFT_NAME + " - " + DefaultMessage.COMPANY_NAME); { consoleScrollPane = new JScrollPane(); inst.getContentPane().add(consoleScrollPane, BorderLayout.CENTER); { consolePane = new JEditorPane(); consoleScrollPane.setViewportView(consolePane); consolePane.setText(""); setConsoleRight(); jConsole = new JConsole(System.out, consolePane); System.setOut(jConsole); System.setErr(jConsole); consolePane.setEditable(false); consolePane.addMouseListener(new MouseAdapter() { /* (non-Javadoc) * @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent) */ public void mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { consolePane.add(consoleRight); consoleRight.show(e.getComponent(), e.getX(), e.getY()); } } }); } } { infoPanel = new JPanel(); inst.getContentPane().add(infoPanel, BorderLayout.SOUTH); infoPanel.setBorder(new LineBorder(new Color(0, 0, 0), 1, false)); infoPanel.setPreferredSize(new Dimension(784, 30)); infoPanel.setLayout(flowLayout); { { statusbar_count = new JTextPane(); infoPanel.add(statusbar_count); statusbar_count .setText(CONTEXT.getMessage("point.statusbar.count", null, Locale.CHINA)); statusbar_count.setBackground(null); statusbar_count.setEditable(false); } { statusbar_count_value = new JTextPane(); infoPanel.add(statusbar_count_value); statusbar_count_value.setText(String.valueOf(SCAN_COUNT)); statusbar_count_value.setBackground(null); statusbar_count_value.setEditable(false); statusbar_count_value.setEnabled(false); } { programPID = new JTextPane(); infoPanel.add(programPID); programPID.setText("PID:"); programPID.setBackground(null); programPID.setEditable(false); } { programPID_value = new JTextPane(); infoPanel.add(programPID_value); programPID_value.setText(JvmPid.getPID()); programPID_value.setBackground(null); programPID_value.setEditable(false); programPID_value.setEnabled(false); } { memory = new JTextPane(); infoPanel.add(memory); memory.setText(CONTEXT.getMessage("gobal.gui.memory", null, Locale.CHINA)); memory.setBackground(null); memory.setEditable(false); } { memory_value = new JTextPane(); infoPanel.add(memory_value); memory_value.setText("0KB"); memory_value.setBackground(null); memory_value.setEditable(false); memory_value.setEnabled(false); MemoryListener memory = new MemoryListener(memory_value); memory.start(); } { runtime = new JTextPane(); infoPanel.add(runtime); runtime.setText(CONTEXT.getMessage("gobal.gui.runtime", null, Locale.CHINA)); runtime.setBackground(null); runtime.setEditable(false); } { runtime_value = new JTextPane(); infoPanel.add(runtime_value); runtime_value.setText("NULL"); runtime_value.setBackground(null); runtime_value.setEditable(false); runtime_value.setEnabled(false); } } } { shortcut = new JPanel(); inst.getContentPane().add(shortcut, BorderLayout.NORTH); shortcut.setSize(784, 35); shortcut.setPreferredSize(new Dimension(784, 35)); shortcut.setBorder(new LineBorder(new Color(0, 0, 0), 1, false)); shortcut.setLayout(new BorderLayout()); { eventText = new JTextPane(); shortcut.add(eventText, BorderLayout.WEST); eventText.setText(CONTEXT.getMessage("point.event.name", null, Locale.CHINA) + ": "); eventText.setEditable(false); eventText.setEnabled(true); eventText.setBackground(null); eventText.setCaretColor(new Color(0, 0, 0)); } { eventTextField = new JTextField(); shortcut.add(eventTextField, BorderLayout.CENTER); eventTextField.setSize(500, 25); eventTextField.setText(""); eventTextField.setPreferredSize(new Dimension(500, 25)); eventTextField.setEditable(false); } { submit = new JButton(); shortcut.add(submit, BorderLayout.EAST); submit.setText(CONTEXT.getMessage("gobal.gui.button.run", null, Locale.CHINA)); submit.setSize(new Dimension(75, 25)); submit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { try { submitActionPerformed(evt); } catch (InterruptedException e) { e.printStackTrace(); } } }); } } } }); }
From source file:com.qawaa.gui.EventWebScanGUI.java
/** * Auto-generated main method to display this JFrame *///w w w .ja va2s.c om public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { EventWebScanGUI inst = new EventWebScanGUI(); inst.setLocationRelativeTo(null); inst.setVisible(true); inst.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JFrame.setDefaultLookAndFeelDecorated(true); FlowLayout flowLayout = new FlowLayout(); flowLayout.setAlignment(FlowLayout.LEFT); flowLayout.setAlignOnBaseline(true); inst.setTitle(PROGRAM_NAME + " [" + PROGRAM_VERSION + "] " + " - " + DefaultMessage.SOFT_NAME + " - " + DefaultMessage.COMPANY_NAME); { consoleScrollPane = new JScrollPane(); inst.getContentPane().add(consoleScrollPane, BorderLayout.CENTER); { consolePane = new JEditorPane(); consoleScrollPane.setViewportView(consolePane); consolePane.setText(""); setConsoleRight(); jConsole = new JConsole(System.out, consolePane); System.setOut(jConsole); System.setErr(jConsole); consolePane.setEditable(false); consolePane.addMouseListener(new MouseAdapter() { /* (non-Javadoc) * @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent) */ public void mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { consolePane.add(consoleRight); consoleRight.show(e.getComponent(), e.getX(), e.getY()); } } }); } } { infoPanel = new JPanel(); inst.getContentPane().add(infoPanel, BorderLayout.SOUTH); infoPanel.setBorder(new LineBorder(new Color(0, 0, 0), 1, false)); infoPanel.setPreferredSize(new Dimension(784, 30)); infoPanel.setLayout(flowLayout); { { statusbar_count = new JTextPane(); infoPanel.add(statusbar_count); statusbar_count.setText( CONTEXT.getMessage("event.web.scan.statusbar.count", null, Locale.CHINA)); statusbar_count.setBackground(null); statusbar_count.setEditable(false); } { statusbar_count_value = new JTextPane(); infoPanel.add(statusbar_count_value); statusbar_count_value.setText(String.valueOf(SCAN_COUNT)); statusbar_count_value.setBackground(null); statusbar_count_value.setEditable(false); statusbar_count_value.setEnabled(false); } { programPID = new JTextPane(); infoPanel.add(programPID); programPID.setText("PID:"); programPID.setBackground(null); programPID.setEditable(false); } { programPID_value = new JTextPane(); infoPanel.add(programPID_value); programPID_value.setText(JvmPid.getPID()); programPID_value.setBackground(null); programPID_value.setEditable(false); programPID_value.setEnabled(false); } { memory = new JTextPane(); infoPanel.add(memory); memory.setText(CONTEXT.getMessage("gobal.gui.memory", null, Locale.CHINA)); memory.setBackground(null); memory.setEditable(false); } { memory_value = new JTextPane(); infoPanel.add(memory_value); memory_value.setText("0KB"); memory_value.setBackground(null); memory_value.setEditable(false); memory_value.setEnabled(false); MemoryListener memory = new MemoryListener(memory_value); memory.start(); } { runtime = new JTextPane(); infoPanel.add(runtime); runtime.setText(CONTEXT.getMessage("gobal.gui.runtime", null, Locale.CHINA)); runtime.setBackground(null); runtime.setEditable(false); } { runtime_value = new JTextPane(); infoPanel.add(runtime_value); runtime_value.setText("NULL"); runtime_value.setBackground(null); runtime_value.setEditable(false); runtime_value.setEnabled(false); } } } { shortcut = new JPanel(); inst.getContentPane().add(shortcut, BorderLayout.NORTH); shortcut.setSize(784, 35); shortcut.setPreferredSize(new Dimension(784, 35)); shortcut.setBorder(new LineBorder(new Color(0, 0, 0), 1, false)); shortcut.setLayout(new BorderLayout()); { eventText = new JTextPane(); shortcut.add(eventText, BorderLayout.WEST); eventText.setText(CONTEXT.getMessage("event.web.scan.name", null, Locale.CHINA) + ": "); eventText.setEditable(false); eventText.setEnabled(true); eventText.setBackground(null); eventText.setCaretColor(new Color(0, 0, 0)); } { eventTextField = new JTextField(); shortcut.add(eventTextField, BorderLayout.CENTER); eventTextField.setSize(500, 25); eventTextField.setText(""); eventTextField.setPreferredSize(new Dimension(500, 25)); eventTextField.setEditable(false); } { submit = new JButton(); shortcut.add(submit, BorderLayout.EAST); submit.setText(CONTEXT.getMessage("gobal.gui.button.run", null, Locale.CHINA)); submit.setSize(new Dimension(75, 25)); submit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { try { submitActionPerformed(evt); } catch (InterruptedException e) { e.printStackTrace(); } } }); } } } }); }
From source file:RoundedLineBorder.java
public RoundedLineBorder() { super(true);//from w ww. jav a 2s.com setLayout(new BorderLayout()); JLabel label = new JLabel("Rounded Corners"); label.setHorizontalAlignment(JLabel.CENTER); LineBorder line = new LineBorder(Color.blue, 2, true); label.setBorder(line); add(label, BorderLayout.CENTER); }
From source file:wsattacker.plugin.dos.dosExtension.gui.DosResultJFrame.java
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The * content of this method is always regenerated by the Form Editor. *///from w w w . j a v a2 s .com @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" // desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { // This will create the chart ChartObject chartObject = new ChartObject(model); JFreeChart chart = chartObject.createOverlaidChart(); jChartPanel = new ChartPanel(chart); jButtonCloseAll = new javax.swing.JButton(); jButtonExport = new javax.swing.JButton(); jButtonHelp = new javax.swing.JButton(); jPanelSuccess = new javax.swing.JPanel(); jLabelSuccess = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jPanelMetadata = new javax.swing.JPanel(); jLabelMetadata = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jSpinner1 = new javax.swing.JSpinner(); jLabel3 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("WS-Attacker - DOS Attack Results"); addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent evt) { handlerCloseFinishedAttack(evt); } }); jChartPanel.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 0, false)); resultGenerator.setJChartPanel((ChartPanel) jChartPanel); // to refresh // just call // this // refernce // in Model! javax.swing.GroupLayout jChartPanelLayout = new javax.swing.GroupLayout(jChartPanel); jChartPanel.setLayout(jChartPanelLayout); jChartPanelLayout.setHorizontalGroup(jChartPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 713, Short.MAX_VALUE)); jChartPanelLayout.setVerticalGroup(jChartPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 653, Short.MAX_VALUE)); jButtonCloseAll.setText("Close"); jButtonCloseAll.setToolTipText("Closes all open attack windows"); jButtonCloseAll.addActionListener(new CloseAttackFinishedController(this)); jButtonExport.setText("Export Results + Request Details"); jButtonExport.setToolTipText("Save attack report"); jButtonExport.addActionListener(new ReportController(resultGenerator)); jButtonHelp.setText("Help Menu"); jButtonHelp.setToolTipText("Open Help menu in web browser"); jButtonHelp.addActionListener(new HelpController(resultGenerator)); jPanelSuccess.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Attack Success Metric", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, java.awt.Color.black)); jLabelSuccess.setFont(new java.awt.Font("Ubuntu", 0, 14)); // NOI18N jLabelSuccess .setText("" + "<html>" + "Attack roundtrip time ratio:<br />" + model.getAttackRoundtripTimeRatio() + " Points - " + model.getAttackRoundtripTimeRatioDescription("text") + "</html>"); jLabel7.setFont(new java.awt.Font("Ubuntu", 0, 14)); // NOI18N jLabel7.setText("" + "<html>" + "Testprobe roundtrip time after attack (" + model.getAttackLongevitySeconds() + " sec)<br />" + model.getTestProbeAttackRoundtripTime() + " sec - " + model.getTestProbeAttackRoundtripTimeDescription("text") + "</html>"); javax.swing.GroupLayout jPanelSuccessLayout = new javax.swing.GroupLayout(jPanelSuccess); jPanelSuccess.setLayout(jPanelSuccessLayout); jPanelSuccessLayout.setHorizontalGroup(jPanelSuccessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelSuccessLayout.createSequentialGroup().addContainerGap() .addGroup( jPanelSuccessLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanelSuccessLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabelSuccess, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE) .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); jPanelSuccessLayout .setVerticalGroup( jPanelSuccessLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelSuccessLayout.createSequentialGroup() .addGroup(jPanelSuccessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabelSuccess, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanelSuccessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); java.net.URL imgURL1 = getClass().getResource(model.getAttackRoundtripTimeRatioDescription("image")); if (imgURL1 != null) { jLabel1.setIcon(new ImageIcon(imgURL1, "Status Attack Metric 1")); } else { System.err.println("Couldn't find file: " + "/IMG/XX.png"); } java.net.URL imgURL4 = getClass().getResource(model.getTestProbeAttackRoundtripTimeDescription("image")); if (imgURL4 != null) { jLabel4.setIcon(new ImageIcon(imgURL4, "Status Attack Metric 4")); } else { System.err.println("Couldn't find file: " + "/IMG/ok.png"); } jPanelMetadata.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Attack Metadata", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, java.awt.Color.black)); jLabelMetadata.setFont(new java.awt.Font("Ubuntu", 0, 14)); // NOI18N jLabelMetadata.setText("" + "<html>" + "<table>" + "<tr>" + "<td>Attack start:</td>" + "<td>" + model.getStartDate() + "</td>" + "</tr>" + "<tr>" + "<td>Attack stop:</td>" + "<td>" + model.getStopDate() + "</td>" + "</tr>" + "<tr>" + "<td>Parallel threads:</td>" + "<td>" + model.getNumberThreads() + "</td>" + "</tr>" + "<tr>" + "<td>Requests per thread:</td>" + "<td>" + model.getNumberRequestsPerThread() + "</td>" + "</tr>" + "<tr>" + "<td>Request repeat interval</td>" + "<td>" + (model.getSecondsBetweenRequests()) + " ms</td>" + "</tr>" + "<tr>" + "<td>Server recovery time</td>" + "<td>" + (model.getSecondsServerLoadRecovery() / 1000) + " sec</td>" + "</tr>" + "<tr>" + "<td>Send testprobes:</td>" + "<td>" + model.getCounterProbesSend() + "</td>" + "</tr>" + "<tr>" + "<td>Testprobe repeat interval</td>" + "<td>" + (model.getSecondsBetweenProbes()) + " ms</td>" + "</tr>" + "<tr>" + "<td>Size testprobe request:</td>" + "<td>" + model.getRequestSizeTestProbe() + " Bytes</td>" + "</tr>" + "<tr>" + "<td>Size untampered padded request:</td>" + "<td>" + model.getRequestSizePaddedUntampered() + " Bytes</td>" + "</tr>" + "<tr>" + "<td>Size tampered padded request:</td>" + "<td>" + model.getRequestSizePaddedTampered() + " Bytes</td>" + "</tr>" + "</table>" + "</html>"); javax.swing.GroupLayout jPanelMetadataLayout = new javax.swing.GroupLayout(jPanelMetadata); jPanelMetadata.setLayout(jPanelMetadataLayout); jPanelMetadataLayout .setHorizontalGroup( jPanelMetadataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelMetadataLayout.createSequentialGroup().addContainerGap() .addComponent(jLabelMetadata, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanelMetadataLayout .setVerticalGroup( jPanelMetadataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelMetadataLayout.createSequentialGroup().addContainerGap() .addComponent(jLabelMetadata, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Diagramm Settings", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, java.awt.Color.black)); jSpinner1.setFont(new java.awt.Font("Ubuntu", 0, 14)); // NOI18N jSpinner1.setModel(new javax.swing.SpinnerNumberModel(1, 1, 60, 1)); jSpinner1.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(javax.swing.event.ChangeEvent evt) { jSpinner1StateChanged(evt); } }); jLabel3.setFont(new java.awt.Font("Ubuntu", 0, 14)); // NOI18N jLabel3.setText("Interval length (default 1 sec)"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel3) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(24, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addContainerGap())); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(18, 18, 18) .addComponent(jChartPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jPanelSuccess, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButtonExport, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButtonCloseAll, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButtonHelp, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanelMetadata, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jChartPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jPanelMetadata, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPanelSuccess, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButtonHelp).addGap(18, 18, 18).addComponent(jButtonExport) .addGap(18, 18, 18).addComponent(jButtonCloseAll))) .addContainerGap())); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width - 1110) / 2, (screenSize.height - 707) / 2, 1110, 707); }
From source file:com.hammurapi.jcapture.CaptureFrame.java
public CaptureFrame(final AbstractCaptureApplet applet) throws Exception { super("Screen capture"); setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("camera.png"))); setUndecorated(true);//from w w w . j av a 2s . co m Translucener.makeFrameTranslucent(this); setAlwaysOnTop(true); this.applet = applet; captureConfig = new CaptureConfig(); captureConfig.load(applet.loadConfig()); captureConfig.setBackgroundProcessor(applet.getBackgroundProcessor()); //--- GUI construction --- capturePanel = new JPanel(); final JLabel dimensionsLabel = new JLabel(""); capturePanel.add(dimensionsLabel, BorderLayout.CENTER); capturePanel.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { super.componentResized(e); dimensionsLabel.setText(e.getComponent().getWidth() + " x " + e.getComponent().getHeight()); } }); JButton captureButton = new JButton(new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { Rectangle bounds = capturePanel.getBounds(); Point loc = bounds.getLocation(); SwingUtilities.convertPointToScreen(loc, capturePanel); bounds.setLocation(loc); Properties props = captureConfig.setRecordingRectangle(bounds); if (props != null) { getApplet().storeConfig(props); } capturing.set(true); setVisible(false); } }); captureButton.setText("Capture"); captureButton.setToolTipText("Create a snapshot of the screen"); capturePanel.add(captureButton, BorderLayout.CENTER); recordButton = new JButton(new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { Rectangle bounds = capturePanel.getBounds(); Point loc = bounds.getLocation(); SwingUtilities.convertPointToScreen(loc, capturePanel); bounds.setLocation(loc); Properties props = captureConfig.setRecordingRectangle(bounds); if (props != null) { getApplet().storeConfig(props); } recording.set(true); setVisible(false); } }); recordButton.setText("Record"); setRecordButtonState(); capturePanel.add(recordButton, BorderLayout.CENTER); JButton optionsButton = new JButton(new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { new CaptureOptionsDialog(CaptureFrame.this).setVisible(true); } }); optionsButton.setText("Options"); capturePanel.add(optionsButton, BorderLayout.CENTER); JButton cancelButton = new JButton(new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { CaptureFrame.this.setVisible(false); } }); cancelButton.setText("Cancel"); capturePanel.add(cancelButton, BorderLayout.CENTER); getContentPane().add(capturePanel, BorderLayout.CENTER); capturePanel.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false)); if (captureConfig.getRecordingRectangle() == null) { setSize(400, 300); setLocationRelativeTo(null); } else { setBounds(captureConfig.getRecordingRectangle()); } Insets dragInsets = new Insets(5, 5, 5, 5); new ComponentResizer(dragInsets, this); ComponentMover cm = new ComponentMover(); cm.registerComponent(this); cm.setDragInsets(dragInsets); addComponentListener(new ComponentListener() { @Override public void componentShown(ComponentEvent e) { // TODO Auto-generated method stub } @Override public void componentResized(ComponentEvent e) { // TODO Auto-generated method stub } @Override public void componentMoved(ComponentEvent e) { // TODO Auto-generated method stub } @Override public void componentHidden(ComponentEvent e) { if (capturing.get()) { capturing.set(false); try { capture(); } catch (Exception ex) { ex.printStackTrace(); } } else if (recording.get()) { recording.set(false); record(); } } }); }
From source file:gtu._work.ui.DirectoryCompareUI.java
private void initGUI() { try {//from w w w .j a va 2 s. com BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); jTabbedPane1.addTab("jPanel1", null, jPanel1, null); { jPanel2 = new JPanel(); BoxLayout jPanel2Layout = new BoxLayout(jPanel2, javax.swing.BoxLayout.X_AXIS); jPanel2.setLayout(jPanel2Layout); jPanel1.add(jPanel2, BorderLayout.NORTH); jPanel2.setPreferredSize(new java.awt.Dimension(660, 36)); { leftDirText = new JTextArea(); leftDirText.setPreferredSize(leftDirText.getPreferredSize()); leftDirText.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false)); JCommonUtil.jTextFieldSetFilePathMouseEvent(leftDirText, true); leftDirText.getDocument() .addDocumentListener(JCommonUtil.getDocumentListener(new HandleDocumentEvent() { @Override public void process(DocumentEvent event) { } })); jPanel2.add(leftDirText); JTextFieldUtil.setupDragDropFilePath(leftDirText, null); } { rightDirText = new JTextArea(); rightDirText.setPreferredSize(rightDirText.getPreferredSize()); rightDirText.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false)); JCommonUtil.jTextFieldSetFilePathMouseEvent(rightDirText, true); rightDirText.getDocument() .addDocumentListener(JCommonUtil.getDocumentListener(new HandleDocumentEvent() { @Override public void process(DocumentEvent event) { } })); jPanel2.add(rightDirText); JTextFieldUtil.setupDragDropFilePath(rightDirText, null); } { executeBtn = new JButton(); jPanel2.add(executeBtn); jPanel2.add(getResetBtn()); executeBtn.setText("\u958b\u59cb\u6bd4\u5c0d"); executeBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { compareStart(); } }); } } { jScrollPane1 = new JScrollPane(); jPanel1.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(660, 362)); { dirCompareTable = new JTable(); // JTableUtil.defaultSetting(dirCompareTable); JTableUtil.defaultSetting_AutoResize(dirCompareTable); jScrollPane1.setViewportView(dirCompareTable); dirCompareTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { dirCompareTableMouseClicked(evt); } }); dirCompareTable.setModel(getDefaultTableModel()); } } { jPanel3 = new JPanel(); FlowLayout jPanel3Layout = new FlowLayout(); jPanel3Layout.setAlignOnBaseline(true); jPanel1.add(jPanel3, BorderLayout.SOUTH); jPanel3.setLayout(jPanel3Layout); jPanel3.setPreferredSize(new java.awt.Dimension(843, 62)); { jLabel1 = new JLabel(); jPanel3.add(jLabel1); jLabel1.setText("\u526f\u6a94\u540d"); } { DefaultComboBoxModel extensionNameComboBoxModel = new DefaultComboBoxModel(); extensionNameComboBox = new JComboBox(); jPanel3.add(extensionNameComboBox); jPanel3.add(getDiffToolComboBox()); jPanel3.add(getJLabel2()); jPanel3.add(getSearchText()); jPanel3.add(getCompareStyleComboBox()); jPanel3.add(getResetQueryBtn()); addDiffMergeChkBox(); extensionNameComboBox.setModel(extensionNameComboBoxModel); { panel = new JPanel(); jTabbedPane1.addTab("New tab", null, panel, null); panel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, })); { lblCustomCommand = new JLabel("custom command"); panel.add(lblCustomCommand, "2, 2, right, default"); } { customCompareText = new JTextField(); customCompareText.setText( "\"C:\\Program Files\\TortoiseGit\\bin\\TortoiseGitMerge.exe\" /base:\"%s\" /theirs:\"%s\""); panel.add(customCompareText, "4, 2, fill, default"); customCompareText.setColumns(10); } { configSaveBtn = new JButton(""); configSaveBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { boolean configChange = false; String customCompareUrl = customCompareText.getText(); if (StringUtils.isNotBlank(customCompareUrl)) { configBean.getConfigProp().setProperty(CUSTOM_COMPARE_URL_KEY, customCompareUrl); configChange = true; } if (configChange) { configBean.store(); JCommonUtil._jOptionPane_showMessageDialog_info( "?!"); } } catch (Exception ex) { JCommonUtil.handleException(ex); } } }); panel.add(configSaveBtn, "2, 36"); } } extensionNameComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { totalScanFiles(null); } }); } } } } pack(); this.setSize(864, 563); JCommonUtil.setJFrameIcon(getOwner(), "images/ico/file_merge.ico"); initConfigBean(); } catch (Exception e) { e.printStackTrace(); } }
From source file:ar.edu.uns.cs.vyglab.arq.rockar.gui.JFrameControlPanel.java
private void initGUI() { try {//from w w w .jav a2s .com setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.setIconImage(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/splash/purple-monkey32.png")) .getImage()); this.setTitle("Rock.AR v2.0"); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent evt) { thisComponentResized(evt); } }); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent evt) { thisWindowClosed(evt); } }); { jPanelSouth = new JPanel(); BorderLayout jPanelSouthLayout = new BorderLayout(); getContentPane().add(jPanelSouth, BorderLayout.SOUTH); jPanelSouth.setLayout(jPanelSouthLayout); { jLabelInformation = new JLabel(); jPanelSouth.add(jLabelInformation, BorderLayout.CENTER); jLabelInformation.setText(DataCenter.langResource.getString("control_information_label")); jLabelInformation.setOpaque(true); jLabelInformation.setBackground(new java.awt.Color(241, 191, 101)); } } { jPanelCenter = new JPanel(); GridLayout jPanelCenterLayout = new GridLayout(1, 1); jPanelCenterLayout.setHgap(5); jPanelCenterLayout.setVgap(5); jPanelCenterLayout.setColumns(1); getContentPane().add(jPanelCenter, BorderLayout.CENTER); jPanelCenter.setLayout(jPanelCenterLayout); { jPanelWest = new JPanel(); BorderLayout jPanelWestLayout = new BorderLayout(); jPanelCenter.add(jPanelWest); jPanelWest.setLayout(jPanelWestLayout); jPanelWest.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false)); { jToolBarMineralTable = new JToolBar(); jToolBarMineralTable.setLayout(new FlowLayout(FlowLayout.LEFT)); jPanelWest.add(jToolBarMineralTable, BorderLayout.NORTH); jToolBarMineralTable.setFloatable(false); jToolBarMineralTable.setFocusable(false); { jButtonNew = new JButton(); jToolBarMineralTable.add(jButtonNew); jButtonNew.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/Actions-tab-new-icon.png"))); jButtonNew.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonNewActionPerformed(evt); } }); } { jButtonOpen = new JButton(); jToolBarMineralTable.add(jButtonOpen); jButtonOpen.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/open.png"))); jButtonOpen.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonOpenActionPerformed(evt); } }); } { jButtonSave = new JButton(); jToolBarMineralTable.add(jButtonSave); jButtonSave.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/save.png"))); jButtonSave.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonSaveActionPerformed(evt); } }); } { jSeparator1 = new JSeparator(); jToolBarMineralTable.add(jSeparator1); jSeparator1.setOrientation(SwingConstants.VERTICAL); jSeparator1.setSize(5, 44); jSeparator1.setPreferredSize(new java.awt.Dimension(5, 44)); } { jButtonAdd = new JButton(); jToolBarMineralTable.add(jButtonAdd); jButtonAdd.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/add.png"))); jButtonAdd.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonAddActionPerformed(evt); } }); } { jButtonEdit = new JButton(); jToolBarMineralTable.add(jButtonEdit); jButtonEdit.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/modify.png"))); jButtonEdit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonEditActionPerformed(evt); } }); } { jButtonRemove = new JButton(); jToolBarMineralTable.add(jButtonRemove); jButtonRemove.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/remove.png"))); jButtonRemove.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonRemoveActionPerformed(evt); } }); } } { jLabelMineralTableInformation = new JLabel(); jPanelWest.add(jLabelMineralTableInformation, BorderLayout.SOUTH); jLabelMineralTableInformation .setText(DataCenter.langResource.getString("total_counted_table")); jLabelMineralTableInformation.setHorizontalAlignment(SwingConstants.LEFT); jLabelMineralTableInformation.setBackground(new java.awt.Color(255, 212, 133)); jLabelMineralTableInformation.setOpaque(true); } { jScrollPaneMineralTable = new JScrollPane(); jPanelWest.add(jScrollPaneMineralTable, BorderLayout.CENTER); { jTableMineralsModel = new RockTableModel( new String[] { DataCenter.langResource.getString("keyvalue_table"), DataCenter.langResource.getString("name_table"), DataCenter.langResource.getString("color_table"), DataCenter.langResource.getString("counted_table"), DataCenter.langResource.getString("area_table") }, 0); // jTableMineralsModel.addRow(new Object[] { // 0, "x?", Color.gray, 0, // "0.00" }); jTableMinerals = new JReadOnlyTable(); jScrollPaneMineralTable.setViewportView(jTableMinerals); jTableMinerals.setModel(jTableMineralsModel); jTableMinerals.setDefaultRenderer(Color.class, new ColorRenderer(true)); TableCellRenderer centerRenderer = new CenterRenderer(); TableColumn column = jTableMinerals.getColumnModel().getColumn(0); column.setCellRenderer(centerRenderer); column = jTableMinerals.getColumnModel().getColumn(1); column.setCellRenderer(centerRenderer); column = jTableMinerals.getColumnModel().getColumn(3); column.setCellRenderer(centerRenderer); column = jTableMinerals.getColumnModel().getColumn(4); column.setCellRenderer(centerRenderer); } } } { jPanelEast = new JPanel(); jPanelCenter.add(jPanelEast); GridLayout jPanelEastLayout = new GridLayout(2, 1); jPanelEastLayout.setHgap(5); jPanelEastLayout.setVgap(5); jPanelEastLayout.setColumns(1); jPanelEast.setLayout(jPanelEastLayout); { jPanelTop = new JPanel(); BorderLayout jPanelTopLayout = new BorderLayout(); jPanelEast.add(jPanelTop); jPanelTop.setLayout(jPanelTopLayout); jPanelTop.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false)); { jToolBarStats = new JToolBar(); jPanelTop.add(jToolBarStats, BorderLayout.NORTH); jToolBarStats.setFloatable(false); jToolBarStats.setFocusable(false); { jButtonExportStats = new JButton(); jButtonExportStats.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { saveChartAsImage(); } }); //jToolBarStats.add(jButtonExportStats); jButtonExportStats.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/export-graph.png"))); } { jButtonExportExcel = new JButton(); //jToolBarStats.add(jButtonExportExcel); //jToolBarMineralTable.add(jButtonExportExcel); jButtonExportExcel.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/excel-icon.png"))); jButtonExportExcel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { exportToExcel(); } }); } { jButtonExportAll = new JButton(); //jToolBarStats.add(jButtonExportAll); jButtonExportAll.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/Mimetypes-application-vnd-ms-excel-icon.png"))); } } { } } { jPanelBottom = new JPanel(); BorderLayout jPanelBottomLayout = new BorderLayout(); jPanelEast.add(jPanelBottom); jPanelBottom.setLayout(jPanelBottomLayout); jPanelBottom.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false)); { jToolBarOverview = new JToolBar(); jPanelBottom.add(jToolBarOverview, BorderLayout.NORTH); jToolBarOverview.setFloatable(false); jToolBarOverview.setFocusable(false); { jButtonExportOverview = new JButton(); jToolBarOverview.add(jButtonExportOverview); jButtonExportOverview.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/export-graph.png"))); jButtonExportOverview.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { exportOverview(); } }); } } { jPanelOverviewContent = new JPanel(); jPanelBottom.add(jPanelOverviewContent, BorderLayout.CENTER); jPanelOverviewContent.setLayout(new GridBagLayout()); this.jLabelOverview = new JLabel(); jPanelOverviewContent.add(this.jLabelOverview); } } } } pack(); this.setSize(800, 600); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }
From source file:cl.uai.webcursos.emarking.desktop.OptionsDialog.java
/** * Create the dialog.//from w ww . j a v a 2s .c om */ public OptionsDialog(Moodle _moodle) { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { cancelled = true; } }); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setIconImage(Toolkit.getDefaultToolkit().getImage(OptionsDialog.class .getResource("/cl/uai/webcursos/emarking/desktop/resources/glyphicons_439_wrench.png"))); setTitle(EmarkingDesktop.lang.getString("emarkingoptions")); setModal(true); setBounds(100, 100, 707, 444); this.moodle = _moodle; this.moodle.loadProperties(); getContentPane().setLayout(new BorderLayout()); { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { okButton = new JButton(EmarkingDesktop.lang.getString("ok")); okButton.setEnabled(false); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { UrlValidator validator = new UrlValidator(UrlValidator.ALLOW_LOCAL_URLS); if (!validator.isValid(moodleurl.getText())) { throw new Exception(EmarkingDesktop.lang.getString("invalidmoodleurl") + " " + moodleurl.getText()); } File f = new File(filename.getText()); if (!f.exists() || f.isDirectory() || (!f.getPath().endsWith(".pdf") && !f.getPath().endsWith(".zip"))) { throw new Exception(EmarkingDesktop.lang.getString("invalidpdffile") + " " + filename.getText()); } if (omrtemplate.getText().trim().length() > 0) { File omrf = new File(omrtemplate.getText()); if (!omrf.exists() || omrf.isDirectory() || (!omrf.getPath().endsWith(".xtmpl"))) { throw new Exception(EmarkingDesktop.lang.getString("invalidomrfile") + " " + omrtemplate.getText()); } } moodle.setLastfile(filename.getText()); moodle.getQrExtractor().setDoubleside(chckbxDoubleSide.isSelected()); moodle.setMaxthreads(Integer.parseInt(getMaxThreads().getSelectedItem().toString())); moodle.setResolution(Integer.parseInt(getResolution().getSelectedItem().toString())); moodle.setMaxzipsize(getMaxZipSize().getSelectedItem().toString()); moodle.setOMRTemplate(omrtemplate.getText()); moodle.setThreshold(Integer.parseInt(spinnerOMRthreshold.getValue().toString())); moodle.setDensity(Integer.parseInt(spinnerOMRdensity.getValue().toString())); moodle.setShapeSize(Integer.parseInt(spinnerOMRshapeSize.getValue().toString())); moodle.setAnonymousPercentage( Integer.parseInt(spinnerAnonymousPercentage.getValue().toString())); moodle.setAnonymousPercentageCustomPage( Integer.parseInt(spinnerAnonymousPercentageCustomPage.getValue().toString())); moodle.setFakeStudents(chckbxMarkersTraining.isSelected()); moodle.saveProperties(); cancelled = false; setVisible(false); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(panel, EmarkingDesktop.lang.getString("invaliddatainform")); } } }); okButton.setActionCommand("OK"); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } { JButton cancelButton = new JButton(EmarkingDesktop.lang.getString("cancel")); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelled = true; setVisible(false); } }); cancelButton.setActionCommand("Cancel"); buttonPane.add(cancelButton); } } JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); getContentPane().add(tabbedPane, BorderLayout.CENTER); panel = new JPanel(); tabbedPane.addTab(EmarkingDesktop.lang.getString("general"), null, panel, null); panel.setLayout(null); JPanel panel_2 = new JPanel(); panel_2.setBorder(new LineBorder(new Color(0, 0, 0), 1, true)); panel_2.setBounds(10, 11, 665, 131); panel.add(panel_2); panel_2.setLayout(null); JLabel lblPassword = new JLabel(EmarkingDesktop.lang.getString("password")); lblPassword.setBounds(10, 99, 109, 14); panel_2.add(lblPassword); lblPassword.setHorizontalAlignment(SwingConstants.RIGHT); password = new JPasswordField(); password.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { testConnection(); } }); password.setBounds(129, 96, 329, 20); panel_2.add(password); this.password.setText(this.moodle.getPassword()); btnTestConnection = new JButton(EmarkingDesktop.lang.getString("connect")); btnTestConnection.setEnabled(false); btnTestConnection.setBounds(468, 93, 172, 27); panel_2.add(btnTestConnection); username = new JTextField(); username.setBounds(129, 65, 329, 20); panel_2.add(username); username.setColumns(10); this.username.setText(this.moodle.getUsername()); moodleurl = new JTextField(); moodleurl.setBounds(129, 34, 329, 20); panel_2.add(moodleurl); moodleurl.setColumns(10); moodleurl.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { warn(); } @Override public void insertUpdate(DocumentEvent e) { warn(); } @Override public void changedUpdate(DocumentEvent e) { warn(); } private void warn() { UrlValidator validator = new UrlValidator(UrlValidator.ALLOW_LOCAL_URLS); if (!validator.isValid(moodleurl.getText()) || !moodleurl.getText().endsWith("/")) { moodleurl.setForeground(Color.RED); btnTestConnection.setEnabled(false); } else { moodleurl.setForeground(Color.BLACK); btnTestConnection.setEnabled(true); } } }); // Initializing values from moodle configuration this.moodleurl.setText(this.moodle.getUrl()); JLabel lblMoodleUrl = new JLabel(EmarkingDesktop.lang.getString("moodleurl")); lblMoodleUrl.setBounds(10, 37, 109, 14); panel_2.add(lblMoodleUrl); lblMoodleUrl.setHorizontalAlignment(SwingConstants.RIGHT); JLabel lblUsername = new JLabel(EmarkingDesktop.lang.getString("username")); lblUsername.setBounds(10, 68, 109, 14); panel_2.add(lblUsername); lblUsername.setHorizontalAlignment(SwingConstants.RIGHT); JLabel lblMoodleSettings = new JLabel(EmarkingDesktop.lang.getString("moodlesettings")); lblMoodleSettings.setBounds(10, 11, 230, 14); panel_2.add(lblMoodleSettings); btnTestConnection.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { testConnection(); } }); JPanel panel_3 = new JPanel(); panel_3.setBorder(new LineBorder(new Color(0, 0, 0), 1, true)); panel_3.setBounds(10, 159, 666, 174); panel.add(panel_3); panel_3.setLayout(null); JLabel lblPdfFile = new JLabel(EmarkingDesktop.lang.getString("pdffile")); lblPdfFile.setBounds(0, 39, 119, 14); panel_3.add(lblPdfFile); lblPdfFile.setHorizontalAlignment(SwingConstants.RIGHT); JLabel lblScanned = new JLabel(EmarkingDesktop.lang.getString("scanned")); lblScanned.setBounds(0, 64, 119, 14); panel_3.add(lblScanned); lblScanned.setHorizontalAlignment(SwingConstants.RIGHT); chckbxDoubleSide = new JCheckBox(EmarkingDesktop.lang.getString("doubleside")); chckbxDoubleSide.setEnabled(false); chckbxDoubleSide.setBounds(125, 60, 333, 23); panel_3.add(chckbxDoubleSide); chckbxDoubleSide.setToolTipText(EmarkingDesktop.lang.getString("doublesidetooltip")); this.chckbxDoubleSide.setSelected(this.moodle.getQrExtractor().isDoubleside()); filename = new JTextField(); filename.setEnabled(false); filename.setBounds(129, 36, 329, 20); panel_3.add(filename); filename.setColumns(10); filename.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { warn(); } @Override public void insertUpdate(DocumentEvent e) { warn(); } @Override public void changedUpdate(DocumentEvent e) { warn(); } private void warn() { validateFileForProcessing(!btnTestConnection.isEnabled()); } }); this.filename.setText(this.moodle.getLastfile()); btnOpenPdfFile = new JButton(EmarkingDesktop.lang.getString("openfile")); btnOpenPdfFile.setEnabled(false); btnOpenPdfFile.setBounds(468, 33, 172, 27); panel_3.add(btnOpenPdfFile); JLabel lblPdfFileSettings = new JLabel(EmarkingDesktop.lang.getString("filesettings")); lblPdfFileSettings.setBounds(10, 11, 230, 14); panel_3.add(lblPdfFileSettings); JLabel lblOMRtemplate = new JLabel(EmarkingDesktop.lang.getString("omrfile")); lblOMRtemplate.setHorizontalAlignment(SwingConstants.RIGHT); lblOMRtemplate.setBounds(0, 142, 119, 14); panel_3.add(lblOMRtemplate); omrtemplate = new JTextField(); omrtemplate.setEnabled(false); omrtemplate.setText((String) null); omrtemplate.setColumns(10); omrtemplate.setBounds(129, 139, 329, 20); panel_3.add(omrtemplate); omrtemplate.setText(this.moodle.getOMRTemplate()); btnOpenOMRTemplate = new JButton(EmarkingDesktop.lang.getString("openomrfile")); btnOpenOMRTemplate.setEnabled(false); btnOpenOMRTemplate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle(EmarkingDesktop.lang.getString("openfiletitle")); chooser.setDialogType(JFileChooser.OPEN_DIALOG); chooser.setFileFilter(new FileFilter() { @Override public String getDescription() { return "*.xtmpl"; } @Override public boolean accept(File arg0) { if (arg0.getName().endsWith(".xtmpl") || arg0.isDirectory()) return true; return false; } }); int retval = chooser.showOpenDialog(panel); if (retval == JFileChooser.APPROVE_OPTION) { omrtemplate.setText(chooser.getSelectedFile().getAbsolutePath()); } else { return; } } }); btnOpenOMRTemplate.setBounds(468, 136, 172, 27); panel_3.add(btnOpenOMRTemplate); lblMarkersTraining = new JLabel((String) EmarkingDesktop.lang.getString("markerstraining")); lblMarkersTraining.setHorizontalAlignment(SwingConstants.RIGHT); lblMarkersTraining.setBounds(0, 89, 119, 14); panel_3.add(lblMarkersTraining); chckbxMarkersTraining = new JCheckBox(EmarkingDesktop.lang.getString("markerstrainingfakestudents")); chckbxMarkersTraining.setBounds(125, 87, 333, 23); panel_3.add(chckbxMarkersTraining); btnOpenPdfFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButton.setEnabled(false); JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle(EmarkingDesktop.lang.getString("openfiletitle")); chooser.setDialogType(JFileChooser.OPEN_DIALOG); chooser.setFileFilter(new FileFilter() { @Override public String getDescription() { return "*.pdf, *.zip"; } @Override public boolean accept(File arg0) { if (arg0.getName().endsWith(".zip") || arg0.getName().endsWith(".pdf") || arg0.isDirectory()) return true; return false; } }); int retval = chooser.showOpenDialog(panel); if (retval == JFileChooser.APPROVE_OPTION) { filename.setText(chooser.getSelectedFile().getAbsolutePath()); okButton.setEnabled(true); } else { return; } } }); JPanel panel_1 = new JPanel(); tabbedPane.addTab(EmarkingDesktop.lang.getString("advanced"), null, panel_1, null); panel_1.setLayout(null); JPanel panel_4 = new JPanel(); panel_4.setLayout(null); panel_4.setBorder(new LineBorder(new Color(0, 0, 0), 1, true)); panel_4.setBounds(10, 11, 665, 131); panel_1.add(panel_4); JLabel lblAdvancedOptions = new JLabel(EmarkingDesktop.lang.getString("advancedoptions")); lblAdvancedOptions.setBounds(10, 11, 233, 14); panel_4.add(lblAdvancedOptions); JLabel lblThreads = new JLabel(EmarkingDesktop.lang.getString("maxthreads")); lblThreads.setBounds(10, 38, 130, 14); panel_4.add(lblThreads); lblThreads.setHorizontalAlignment(SwingConstants.RIGHT); JLabel lblSomething = new JLabel(EmarkingDesktop.lang.getString("separatezipfiles")); lblSomething.setBounds(10, 73, 130, 14); panel_4.add(lblSomething); lblSomething.setHorizontalAlignment(SwingConstants.RIGHT); JLabel label = new JLabel(EmarkingDesktop.lang.getString("resolution")); label.setBounds(10, 105, 130, 14); panel_4.add(label); label.setHorizontalAlignment(SwingConstants.RIGHT); resolution = new JComboBox<Integer>(); resolution.setBounds(150, 99, 169, 27); panel_4.add(resolution); resolution.setModel(new DefaultComboBoxModel<Integer>(new Integer[] { 75, 100, 150, 300, 400, 500, 600 })); resolution.setSelectedIndex(2); this.resolution.setSelectedItem(this.moodle.getQrExtractor().getResolution()); maxZipSize = new JComboBox<String>(); maxZipSize.setBounds(150, 67, 169, 27); panel_4.add(maxZipSize); maxZipSize.setModel(new DefaultComboBoxModel<String>(new String[] { "<dynamic>", "2Mb", "4Mb", "8Mb", "16Mb", "32Mb", "64Mb", "128Mb", "256Mb", "512Mb", "1024Mb" })); maxZipSize.setSelectedIndex(6); this.maxZipSize.setSelectedItem(this.moodle.getMaxZipSizeString()); maxThreads = new JComboBox<Integer>(); maxThreads.setBounds(150, 32, 169, 27); panel_4.add(maxThreads); maxThreads.setModel(new DefaultComboBoxModel<Integer>(new Integer[] { 2, 4, 8, 16 })); maxThreads.setSelectedIndex(1); this.maxThreads.setSelectedItem(this.moodle.getQrExtractor().getMaxThreads()); JPanel panel_5 = new JPanel(); panel_5.setLayout(null); panel_5.setBorder(new LineBorder(new Color(0, 0, 0), 1, true)); panel_5.setBounds(10, 153, 665, 131); panel_1.add(panel_5); JLabel lblOMRoptions = new JLabel(EmarkingDesktop.lang.getString("omroptions")); lblOMRoptions.setBounds(10, 11, 233, 14); panel_5.add(lblOMRoptions); JLabel lblOMRthreshold = new JLabel(EmarkingDesktop.lang.getString("omrthreshold")); lblOMRthreshold.setHorizontalAlignment(SwingConstants.RIGHT); lblOMRthreshold.setBounds(10, 32, 130, 14); panel_5.add(lblOMRthreshold); JLabel lblShapeSize = new JLabel(EmarkingDesktop.lang.getString("omrshapesize")); lblShapeSize.setHorizontalAlignment(SwingConstants.RIGHT); lblShapeSize.setBounds(10, 99, 130, 14); panel_5.add(lblShapeSize); JLabel lblDensity = new JLabel(EmarkingDesktop.lang.getString("omrdensity")); lblDensity.setHorizontalAlignment(SwingConstants.RIGHT); lblDensity.setBounds(10, 70, 130, 14); panel_5.add(lblDensity); spinnerOMRthreshold = new JSpinner(); spinnerOMRthreshold.setBounds(150, 32, 169, 20); panel_5.add(spinnerOMRthreshold); spinnerOMRthreshold.setValue(this.moodle.getOMRthreshold()); spinnerOMRdensity = new JSpinner(); spinnerOMRdensity.setBounds(150, 67, 169, 20); panel_5.add(spinnerOMRdensity); spinnerOMRdensity.setValue(this.moodle.getOMRdensity()); spinnerOMRshapeSize = new JSpinner(); spinnerOMRshapeSize.setBounds(150, 99, 169, 20); panel_5.add(spinnerOMRshapeSize); spinnerOMRshapeSize.setValue(this.moodle.getOMRshapeSize()); JLabel lblAnonymousPercentage = new JLabel( "<html>" + EmarkingDesktop.lang.getString("anonymouspercentage") + "</html>"); lblAnonymousPercentage.setHorizontalAlignment(SwingConstants.RIGHT); lblAnonymousPercentage.setBounds(329, 32, 130, 27); panel_5.add(lblAnonymousPercentage); spinnerAnonymousPercentage = new JSpinner(); spinnerAnonymousPercentage.setBounds(469, 32, 169, 20); panel_5.add(spinnerAnonymousPercentage); spinnerAnonymousPercentage.setValue(this.moodle.getAnonymousPercentage()); JLabel lblAnonymousPercentageCustomPage = new JLabel( "<html>" + EmarkingDesktop.lang.getString("anonymouspercentagecustompage") + "</html>"); lblAnonymousPercentageCustomPage.setHorizontalAlignment(SwingConstants.RIGHT); lblAnonymousPercentageCustomPage.setBounds(329, 70, 130, 27); panel_5.add(lblAnonymousPercentageCustomPage); spinnerAnonymousPercentageCustomPage = new JSpinner(); spinnerAnonymousPercentageCustomPage.setBounds(469, 70, 169, 20); panel_5.add(spinnerAnonymousPercentageCustomPage); spinnerAnonymousPercentageCustomPage.setValue(this.moodle.getAnonymousPercentageCustomPage()); JLabel lblCustomPage = new JLabel( "<html>" + EmarkingDesktop.lang.getString("anonymouscustompage") + "</html>"); lblCustomPage.setHorizontalAlignment(SwingConstants.RIGHT); lblCustomPage.setBounds(329, 99, 130, 27); panel_5.add(lblCustomPage); spinnerCustomPage = new JSpinner(); spinnerCustomPage.setBounds(469, 99, 169, 20); panel_5.add(spinnerCustomPage); spinnerCustomPage.setValue(this.moodle.getAnonymousCustomPage()); }
From source file:eu.crisis_economics.abm.dashboard.Page_Parameters.java
private Container initContainer() { JPanel containerPanel = new JPanel(new CardLayout()); JLabel loadingModelLabel = new JLabel("Loading model..."); loadingModelLabel.setHorizontalAlignment(SwingConstants.CENTER); containerPanel.add(loadingModelLabel, LOADING_MODEL_ID); tabbedPane = new JTabbedPane(); containerPanel.add(tabbedPane, PARAMETERS_PANEL_ID); // create two number of turns field numberOfTurnsField = new JFormattedTextField(); numberOfTurnsField.setFocusLostBehavior(JFormattedTextField.COMMIT); numberOfTurnsField.setInputVerifier(new InputVerifier() { @Override//ww w . java 2 s .c o m public boolean verify(final JComponent input) { if (!checkNumberOfTurnsField(true)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberOfTurnsField.getLocationOnScreen(); final JLabel message = new JLabel("Please specify a (possibly floating point) number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberOfTurnsField, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberOfTurnsField.setText(String.valueOf(Dashboard.NUMBER_OF_TURNS)); numberOfTurnsField .setToolTipText("The turn when the simulation should stop specified as an integer value."); numberOfTurnsField.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); numberOfTurnsFieldPSW = new JFormattedTextField(); numberOfTurnsFieldPSW.setFocusLostBehavior(JFormattedTextField.COMMIT); numberOfTurnsFieldPSW.setInputVerifier(new InputVerifier() { @Override public boolean verify(final JComponent input) { if (!checkNumberOfTurnsField(false)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberOfTurnsFieldPSW.getLocationOnScreen(); final JLabel message = new JLabel("Please specify a (possibly floating point) number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberOfTurnsFieldPSW, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberOfTurnsFieldPSW.setText(String.valueOf(Dashboard.NUMBER_OF_TURNS)); numberOfTurnsFieldPSW .setToolTipText("The turn when the simulation should stop specified as an integer value."); numberOfTurnsFieldPSW.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); // create two number of time-steps to ignore field numberTimestepsIgnored = new JFormattedTextField(); numberTimestepsIgnored.setFocusLostBehavior(JFormattedTextField.COMMIT); numberTimestepsIgnored.setInputVerifier(new InputVerifier() { @Override public boolean verify(final JComponent input) { if (!checkNumberTimestepsIgnored(true)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberTimestepsIgnored.getLocationOnScreen(); final JLabel message = new JLabel("Please specify an integer number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberTimestepsIgnored, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberTimestepsIgnored.setText(String.valueOf(Dashboard.NUMBER_OF_TIMESTEPS_TO_IGNORE)); numberTimestepsIgnored.setToolTipText( "The turn when the simulation should start charting specified as an integer value."); numberTimestepsIgnored.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); numberTimestepsIgnoredPSW = new JFormattedTextField(); numberTimestepsIgnoredPSW.setFocusLostBehavior(JFormattedTextField.COMMIT); numberTimestepsIgnoredPSW.setInputVerifier(new InputVerifier() { @Override public boolean verify(final JComponent input) { if (!checkNumberTimestepsIgnored(false)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberTimestepsIgnoredPSW.getLocationOnScreen(); final JLabel message = new JLabel("Please specify an integer number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberTimestepsIgnoredPSW, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberTimestepsIgnoredPSW.setText(String.valueOf(Dashboard.NUMBER_OF_TIMESTEPS_TO_IGNORE)); numberTimestepsIgnoredPSW.setToolTipText( "The turn when the simulation should start charting specified as an integer value."); numberTimestepsIgnoredPSW.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); onLineChartsCheckBox = new JCheckBox(); // onLineChartsCheckBoxPSW = new JCheckBox(); advancedChartsCheckBox = new JCheckBox(); advancedChartsCheckBox.setSelected(true); // create the scroll pane for the simple parameter setting page JLabel label = null; label = new JLabel(new ImageIcon(new ImageIcon(getClass().getResource(DECORATION_IMAGE)).getImage() .getScaledInstance(DECORATION_IMAGE_WIDTH, -1, Image.SCALE_SMOOTH))); Style.registerCssClasses(label, Dashboard.CSS_CLASS_COMMON_PANEL); parametersScrollPane = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); parametersScrollPane.setBorder(null); parametersScrollPane.setViewportBorder(null); breadcrumb = new Breadcrumb(); Style.registerCssClasses(breadcrumb, CSS_ID_BREADCRUMB); singleRunParametersPanel = new ScrollableJPanel(new SizeProvider() { @Override public int getHeight() { Component component = tabbedPane.getSelectedComponent(); if (component == null) { return 0; } JScrollBar scrollBar = parametersScrollPane.getHorizontalScrollBar(); return component.getSize().height - breadcrumb.getHeight() - (scrollBar.isVisible() ? scrollBar.getPreferredSize().height : 0); } @Override public int getWidth() { final int hScrollBarWidth = parametersScrollPane.getHorizontalScrollBar().getPreferredSize().width; final int width = dashboard.getSize().width - Page_Parameters.DECORATION_IMAGE_WIDTH - hScrollBarWidth; return width; } }); BoxLayout boxLayout = new BoxLayout(singleRunParametersPanel, BoxLayout.X_AXIS); singleRunParametersPanel.setLayout(boxLayout); parametersScrollPane.setViewportView(singleRunParametersPanel); JPanel breadcrumbPanel = new JPanel(new BorderLayout()); breadcrumbPanel.add(breadcrumb, BorderLayout.NORTH); breadcrumbPanel.add(parametersScrollPane, BorderLayout.CENTER); final JPanel simpleForm = FormsUtils.build("p ~ p:g", "01 t:p", label, breadcrumbPanel).getPanel(); Style.registerCssClasses(simpleForm, Dashboard.CSS_CLASS_COMMON_PANEL); tabbedPane.add("Single run", simpleForm); // create the form for the parameter sweep setting page tabbedPane.add("Parameter sweep", createParamsweepGUI()); gaSearchHandler = new GASearchHandler(currentModelHandler); gaSearchPanel = new GASearchPanel(gaSearchHandler, this); tabbedPane.add("Genetic Algorithm Search", gaSearchPanel); return containerPanel; }