Example usage for javax.swing BorderFactory createEtchedBorder

List of usage examples for javax.swing BorderFactory createEtchedBorder

Introduction

In this page you can find the example usage for javax.swing BorderFactory createEtchedBorder.

Prototype

public static Border createEtchedBorder() 

Source Link

Document

Creates a border with an "etched" look using the component's current background color for highlighting and shading.

Usage

From source file:mazewar.Mazewar.java

/**
 * The place where all the pieces are put together.
 *//*from  ww w .j  a va2s. c om*/
public Mazewar(String zkServer, int zkPort, int port, String name, String game, boolean robot) {
    super("ECE419 Mazewar");
    consolePrintLn("ECE419 Mazewar started!");

    /* Set up parent */
    ZK_PARENT += game;

    // Throw up a dialog to get the GUIClient name.
    if (name != null) {
        clientId = name;
    } else {
        clientId = JOptionPane.showInputDialog("Enter your name");
    }
    if ((clientId == null) || (clientId.length() == 0)) {
        Mazewar.quit();
    }

    /* Connect to ZooKeeper and get sequencer details */
    List<ClientNode> nodeList = null;
    try {
        zkWatcher = new ZkWatcher();
        zkConnected = new CountDownLatch(1);
        zooKeeper = new ZooKeeper(zkServer + ":" + zkPort, ZK_TIMEOUT, new Watcher() {
            @Override
            public void process(WatchedEvent event) {
                /* Release Lock if ZooKeeper is connected */
                if (event.getState() == SyncConnected) {
                    zkConnected.countDown();
                } else {
                    System.err.println("Could not connect to ZooKeeper!");
                    System.exit(0);
                }
            }
        });
        zkConnected.await();

        /* Successfully connected, now create our node on ZooKeeper */
        zooKeeper.create(Joiner.on('/').join(ZK_PARENT, clientId),
                Joiner.on(':').join(InetAddress.getLocalHost().getHostAddress(), port).getBytes(),
                ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);

        /* Get Seed from Parent */
        mazeSeed = Long.parseLong(new String(zooKeeper.getData(ZK_PARENT, false, null)));

        /* Initialize Sequence Number */
        sequenceNumber = new AtomicInteger(zooKeeper.exists(ZK_PARENT, false).getVersion());

        /* Get list of nodes */
        nodeList = ClientNode.sortList(zooKeeper.getChildren(ZK_PARENT, false));
    } catch (Exception e) {
        e.printStackTrace();
        System.exit(1);
    }

    // Create the maze
    maze = new MazeImpl(new Point(mazeWidth, mazeHeight), mazeSeed);
    assert (maze != null);

    // Have the ScoreTableModel listen to the maze to find
    // out how to adjust scores.
    ScoreTableModel scoreModel = new ScoreTableModel();
    assert (scoreModel != null);
    maze.addMazeListener(scoreModel);

    /* Initialize packet queue */
    packetQueue = new ArrayBlockingQueue<MazePacket>(QUEUE_SIZE);
    sequencedQueue = new PriorityBlockingQueue<MazePacket>(QUEUE_SIZE, new Comparator<MazePacket>() {
        @Override
        public int compare(MazePacket o1, MazePacket o2) {
            return o1.sequenceNumber.compareTo(o2.sequenceNumber);
        }
    });

    /* Inject Event Bus into Client */
    Client.setEventBus(eventBus);

    /* Initialize ZMQ Context */
    context = ZMQ.context(2);

    /* Set up publisher */
    publisher = context.socket(ZMQ.PUB);
    publisher.bind("tcp://*:" + port);
    System.out.println("ZeroMQ Publisher Bound On: " + port);

    try {
        Thread.sleep(100);
    } catch (Exception e) {
        e.printStackTrace();
    }

    /* Set up subscriber */
    subscriber = context.socket(ZMQ.SUB);
    subscriber.subscribe(ArrayUtils.EMPTY_BYTE_ARRAY);

    clients = new ConcurrentHashMap<String, Client>();
    try {
        for (ClientNode client : nodeList) {
            if (client.getName().equals(clientId)) {
                clientPath = ZK_PARENT + "/" + client.getPath();
                guiClient = robot ? new RobotClient(clientId) : new GUIClient(clientId);
                clients.put(clientId, guiClient);
                maze.addClient(guiClient);
                eventBus.register(guiClient);
                subscriber.connect("tcp://" + new String(zooKeeper.getData(clientPath, false, null)));
            } else {
                addRemoteClient(client);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    checkNotNull(guiClient, "Should have received our clientId in CLIENTS list!");

    // Create the GUIClient and connect it to the KeyListener queue
    this.addKeyListener(guiClient);
    this.isRobot = robot;

    // Use braces to force constructors not to be called at the beginning of the
    // constructor.
    /*{
    maze.addClient(new RobotClient("Norby"));
    maze.addClient(new RobotClient("Robbie"));
    maze.addClient(new RobotClient("Clango"));
    maze.addClient(new RobotClient("Marvin"));
    }*/

    // Create the panel that will display the maze.
    overheadPanel = new OverheadMazePanel(maze, guiClient);
    assert (overheadPanel != null);
    maze.addMazeListener(overheadPanel);

    // Don't allow editing the console from the GUI
    console.setEditable(false);
    console.setFocusable(false);
    console.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder()));

    // Allow the console to scroll by putting it in a scrollpane
    JScrollPane consoleScrollPane = new JScrollPane(console);
    assert (consoleScrollPane != null);
    consoleScrollPane
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Console"));

    // Create the score table
    scoreTable = new JTable(scoreModel);
    assert (scoreTable != null);
    scoreTable.setFocusable(false);
    scoreTable.setRowSelectionAllowed(false);

    // Allow the score table to scroll too.
    JScrollPane scoreScrollPane = new JScrollPane(scoreTable);
    assert (scoreScrollPane != null);
    scoreScrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Scores"));

    // Create the layout manager
    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    getContentPane().setLayout(layout);

    // Define the constraints on the components.
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1.0;
    c.weighty = 3.0;
    c.gridwidth = GridBagConstraints.REMAINDER;
    layout.setConstraints(overheadPanel, c);
    c.gridwidth = GridBagConstraints.RELATIVE;
    c.weightx = 2.0;
    c.weighty = 1.0;
    layout.setConstraints(consoleScrollPane, c);
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.weightx = 1.0;
    layout.setConstraints(scoreScrollPane, c);

    // Add the components
    getContentPane().add(overheadPanel);
    getContentPane().add(consoleScrollPane);
    getContentPane().add(scoreScrollPane);

    // Pack everything neatly.
    pack();

    // Let the magic begin.
    setVisible(true);
    overheadPanel.repaint();
    this.requestFocusInWindow();
}

From source file:org.jfree.chart.demo.ThermometerDemo.java

/**
 * Initialises the class.//from   w  ww .ja v a2  s  .  c o  m
 *
 * @throws Exception for any exception.
 */
void jbInit() throws Exception {

    //data.setRange(new Double(-20), new Double(20));
    this.thermo[0] = this.thermo1;
    this.thermo[1] = this.thermo2;
    this.thermo[2] = this.thermo3;

    this.thermo[0].setValue(0.0);
    this.thermo[1].setValue(0.2);
    this.thermo[2].setValue(0.3);

    this.thermo[0].setBackground(Color.white);
    this.thermo[2].setBackground(Color.white);

    this.thermo[0].setOutlinePaint(null);
    this.thermo[1].setOutlinePaint(null);
    this.thermo[2].setOutlinePaint(null);

    this.thermo[0].setUnits(0);
    this.thermo[1].setUnits(1);
    this.thermo[2].setUnits(2);

    //thermo[0].setFont(new Font("SansSerif", Font.BOLD, 20));
    this.thermo[0].setShowValueLines(true);
    this.thermo[0].setFollowDataInSubranges(true);
    this.thermo[1].setValueLocation(1);

    this.thermo[1].setForeground(Color.blue);
    this.thermo[2].setForeground(Color.pink);

    this.thermo[0].setRange(-10.0, 40.0);
    this.thermo[0].setSubrangeInfo(0, -50.0, 20.0, -10.0, 22.0);
    this.thermo[0].setSubrangeInfo(1, 20.0, 24.0, 18.0, 26.0);
    this.thermo[0].setSubrangeInfo(2, 24.0, 100.0, 22.0, 40.0);

    this.thermo[0].addSubtitle("Sea Water Temp");
    this.thermo[1].addSubtitle("Air Temp", new Font("SansSerif", Font.PLAIN, 16));
    this.thermo[2].addSubtitle("Ship Temp", new Font("SansSerif", Font.ITALIC + Font.BOLD, 20));

    this.thermo[1].setValueFormat(new DecimalFormat("#0.0"));
    this.thermo[2].setValueFormat(new DecimalFormat("#0.00"));

    this.pickShow[0] = this.pickShow0;
    this.pickShow[1] = this.pickShow1;
    this.pickShow[2] = this.pickShow2;

    this.pickAxis[0] = this.pickAxis0;
    this.pickAxis[1] = this.pickAxis1;
    this.pickAxis[2] = this.pickAxis2;

    this.pickAxis[0].setSelectedIndex(2);
    this.pickAxis[1].setSelectedIndex(2);
    this.pickAxis[2].setSelectedIndex(2);

    setLayout(this.gridLayout1);
    this.butDown3.setText("<");
    this.butDown3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(2, -1);
        }
    });
    this.butUp3.setText(">");
    this.butUp3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(2, 1);
        }
    });
    this.jPanel1.setLayout(this.borderLayout2);
    this.jPanel3.setLayout(this.borderLayout3);
    this.butDown2.setText("<");
    this.butDown2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(1, -1);
        }
    });
    this.butUp2.setText(">");
    this.butUp2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(1, 1);
        }
    });
    this.butUp1.setText(">");
    this.butUp1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(0, 1);
        }
    });
    this.butDown1.setText("<");
    this.butDown1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(0, -1);
        }
    });
    this.jPanel5.setLayout(this.borderLayout1);
    this.pickShow0.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowValue(0);
        }
    });
    this.pickShow1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowValue(1);
        }
    });
    this.pickShow2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowValue(2);
        }
    });

    this.pickAxis0.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowAxis(0);
        }
    });
    this.pickAxis1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowAxis(1);
        }
    });
    this.pickAxis2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowAxis(2);
        }
    });

    this.jPanel9.setLayout(this.gridLayout2);
    this.gridLayout2.setColumns(1);
    this.jPanel8.setLayout(this.gridLayout3);
    this.jPanel7.setLayout(this.gridLayout4);
    this.jPanel5.setBorder(BorderFactory.createEtchedBorder());
    this.jPanel3.setBorder(BorderFactory.createEtchedBorder());
    this.jPanel1.setBorder(BorderFactory.createEtchedBorder());
    this.jPanel6.setBackground(Color.white);
    this.jPanel2.setBackground(Color.white);
    this.jPanel9.setBackground(Color.white);
    this.jPanel10.setLayout(this.borderLayout4);
    this.butDown4.setText("<");
    this.butDown4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setMeterValue(-1.1);
        }
    });
    this.butUp4.setText(">");
    this.butUp4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setMeterValue(1.1);
        }
    });
    this.jPanel1.add(this.thermo3, BorderLayout.CENTER);
    this.jPanel1.add(this.jPanel2, BorderLayout.SOUTH);
    this.jPanel2.add(this.butDown3, null);
    this.jPanel2.add(this.butUp3, null);
    this.jPanel1.add(this.jPanel9, BorderLayout.NORTH);
    this.jPanel9.add(this.pickShow2, null);
    this.jPanel9.add(this.pickAxis2, null);
    add(this.jPanel10, null);
    this.jPanel10.add(this.jPanel11, BorderLayout.SOUTH);
    this.jPanel11.add(this.butDown4, null);
    this.jPanel11.add(this.butUp4, null);
    this.jPanel4.add(this.butDown2, null);
    this.jPanel4.add(this.butUp2, null);
    this.jPanel3.add(this.jPanel8, BorderLayout.NORTH);
    this.jPanel8.add(this.pickShow1, null);
    this.jPanel8.add(this.pickAxis1, null);
    this.jPanel3.add(this.thermo2, BorderLayout.CENTER);
    this.jPanel3.add(this.jPanel4, BorderLayout.SOUTH);
    add(this.jPanel5, null);
    this.jPanel5.add(this.thermo1, BorderLayout.CENTER);
    this.jPanel5.add(this.jPanel6, BorderLayout.SOUTH);
    this.jPanel6.add(this.butDown1, null);
    this.jPanel6.add(this.butUp1, null);
    this.jPanel5.add(this.jPanel7, BorderLayout.NORTH);
    this.jPanel7.add(this.pickShow0, null);
    this.jPanel7.add(this.pickAxis0, null);
    add(this.jPanel3, null);
    add(this.jPanel1, null);
    this.jPanel10.add(this.panelMeter, BorderLayout.CENTER);
}

From source file:net.sf.xmm.moviemanager.gui.DialogIMDB.java

/**
 * Creates a panel containing a text field used to search
 * @return//from  w w w .j av  a  2 s  .c  o m
 */
private JPanel createSearchStringPanel() {

    JPanel searchStringPanel = new JPanel();
    searchStringPanel.setLayout(new BorderLayout());
    searchStringPanel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
                    Localizer.get("DialogIMDB.panel-search-string.title")), //$NON-NLS-1$
            BorderFactory.createEmptyBorder(4, 4, 4, 4)));

    searchStringField = new JTextField(27);
    searchStringField.setActionCommand("Search String:"); //$NON-NLS-1$
    searchStringField.setCaretPosition(0);
    searchStringField.addKeyListener(new KeyAdapter() {
        public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                executeSearch();
            }
        }
    });

    searchStringPanel.add(searchStringField, BorderLayout.NORTH);

    return searchStringPanel;
}

From source file:com.unionpay.upmp.jmeterplugin.gui.UPMPUrlConfigGui.java

private void init() {// called from ctor, so must not be overridable
    this.setLayout(new BorderLayout());

    // WEB REQUEST PANEL
    JPanel webRequestPanel = new JPanel();
    webRequestPanel.setLayout(new BorderLayout());
    webRequestPanel.setBorder(/*from   w w  w.  j  av a2s.c  om*/
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), UPMPConstant.upmp_request)); // $NON-NLS-1$

    JPanel northPanel = new JPanel();
    northPanel.setLayout(new BoxLayout(northPanel, BoxLayout.Y_AXIS));
    northPanel.add(getProtocolAndMethodPanel());
    northPanel.add(getPathPanel());

    webRequestPanel.add(northPanel, BorderLayout.NORTH);
    webRequestPanel.add(getParameterPanel(), BorderLayout.CENTER);

    this.add(getWebServerTimeoutPanel(), BorderLayout.NORTH);
    this.add(webRequestPanel, BorderLayout.CENTER);
    this.add(getProxyServerPanel(), BorderLayout.SOUTH);
}

From source file:com.mirth.connect.client.ui.editors.filter.FilterPane.java

/**
 * This method is called from within the constructor to initialize the form.
 *///from  ww w.j av  a 2  s  . c om
public void initComponents() {

    // the available panels (cards)
    rulePanel = new BasePanel();
    blankPanel = new BasePanel();

    scriptTextArea = new MirthRTextScrollPane(null, true, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, false);
    scriptTextArea.setBackground(new Color(204, 204, 204));
    scriptTextArea.setBorder(BorderFactory.createEtchedBorder());
    scriptTextArea.getTextArea().setEditable(false);
    scriptTextArea.getTextArea().setDropTarget(null);

    generatedScriptPanel = new JPanel();
    generatedScriptPanel.setBackground(Color.white);
    generatedScriptPanel.setLayout(new CardLayout());
    generatedScriptPanel.add(scriptTextArea, "");

    tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Rule", rulePanel);

    tabbedPane.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            switchTab = (lastSelectedIndex == 0 && tabbedPane.getSelectedIndex() == 1) ? true : false;
            updateCodePanel(null);
        }
    });

    for (FilterRulePlugin filterRulePlugin : LoadedExtensions.getInstance().getFilterRulePlugins().values()) {
        filterRulePlugin.initialize(this);
    }

    // establish the cards to use in the Transformer
    rulePanel.addCard(blankPanel, BLANK_TYPE);
    for (FilterRulePlugin plugin : LoadedExtensions.getInstance().getFilterRulePlugins().values()) {
        rulePanel.addCard(plugin.getPanel(), plugin.getPluginPointName());
    }

    filterTablePane = new JScrollPane();

    viewTasks = new JXTaskPane();
    viewTasks.setTitle("Mirth Views");
    viewTasks.setFocusable(false);

    filterPopupMenu = new JPopupMenu();

    viewTasks.add(initActionCallback("accept", "Return back to channel.",
            ActionFactory.createBoundAction("accept", "Back to Channel", "B"),
            new ImageIcon(Frame.class.getResource("images/resultset_previous.png"))));
    parent.setNonFocusable(viewTasks);
    viewTasks.setVisible(false);
    parent.taskPaneContainer.add(viewTasks, parent.taskPaneContainer.getComponentCount() - 1);

    filterTasks = new JXTaskPane();
    filterTasks.setTitle("Filter Tasks");
    filterTasks.setFocusable(false);

    // add new rule task
    filterTasks.add(initActionCallback("addNewRule", "Add a new filter rule.",
            ActionFactory.createBoundAction("addNewRule", "Add New Rule", "N"),
            new ImageIcon(Frame.class.getResource("images/add.png"))));
    JMenuItem addNewRule = new JMenuItem("Add New Rule");
    addNewRule.setIcon(new ImageIcon(Frame.class.getResource("images/add.png")));
    addNewRule.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            addNewRule();
        }
    });
    filterPopupMenu.add(addNewRule);

    // delete rule task
    filterTasks.add(initActionCallback("deleteRule", "Delete the currently selected filter rule.",
            ActionFactory.createBoundAction("deleteRule", "Delete Rule", "X"),
            new ImageIcon(Frame.class.getResource("images/delete.png"))));
    JMenuItem deleteRule = new JMenuItem("Delete Rule");
    deleteRule.setIcon(new ImageIcon(Frame.class.getResource("images/delete.png")));
    deleteRule.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            deleteRule();
        }
    });
    filterPopupMenu.add(deleteRule);

    filterTasks.add(initActionCallback("doImport", "Import a filter from an XML file.",
            ActionFactory.createBoundAction("doImport", "Import Filter", "I"),
            new ImageIcon(Frame.class.getResource("images/report_go.png"))));
    JMenuItem importFilter = new JMenuItem("Import Filter");
    importFilter.setIcon(new ImageIcon(Frame.class.getResource("images/report_go.png")));
    importFilter.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            doImport();
        }
    });
    filterPopupMenu.add(importFilter);

    filterTasks.add(initActionCallback("doExport", "Export the filter to an XML file.",
            ActionFactory.createBoundAction("doExport", "Export Filter", "E"),
            new ImageIcon(Frame.class.getResource("images/report_disk.png"))));
    JMenuItem exportFilter = new JMenuItem("Export Filter");
    exportFilter.setIcon(new ImageIcon(Frame.class.getResource("images/report_disk.png")));
    exportFilter.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            doExport();
        }
    });
    filterPopupMenu.add(exportFilter);

    filterTasks.add(initActionCallback("doValidate", "Validate the currently viewed script.",
            ActionFactory.createBoundAction("doValidate", "Validate Script", "V"),
            new ImageIcon(Frame.class.getResource("images/accept.png"))));
    JMenuItem validateStep = new JMenuItem("Validate Script");
    validateStep.setIcon(new ImageIcon(Frame.class.getResource("images/accept.png")));
    validateStep.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            doValidate();
        }
    });
    filterPopupMenu.add(validateStep);

    // move rule up task
    filterTasks.add(initActionCallback("moveRuleUp", "Move the currently selected rule up.",
            ActionFactory.createBoundAction("moveRuleUp", "Move Rule Up", "P"),
            new ImageIcon(Frame.class.getResource("images/arrow_up.png"))));
    JMenuItem moveRuleUp = new JMenuItem("Move Rule Up");
    moveRuleUp.setIcon(new ImageIcon(Frame.class.getResource("images/arrow_up.png")));
    moveRuleUp.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            moveRuleUp();
        }
    });
    filterPopupMenu.add(moveRuleUp);

    // move rule down task
    filterTasks.add(initActionCallback("moveRuleDown", "Move the currently selected rule down.",
            ActionFactory.createBoundAction("moveRuleDown", "Move Rule Down", "D"),
            new ImageIcon(Frame.class.getResource("images/arrow_down.png"))));
    JMenuItem moveRuleDown = new JMenuItem("Move Rule Down");
    moveRuleDown.setIcon(new ImageIcon(Frame.class.getResource("images/arrow_down.png")));
    moveRuleDown.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            moveRuleDown();
        }
    });
    filterPopupMenu.add(moveRuleDown);

    // add the tasks to the taskpane, and the taskpane to the mirth client
    parent.setNonFocusable(filterTasks);
    filterTasks.setVisible(false);
    parent.taskPaneContainer.add(filterTasks, parent.taskPaneContainer.getComponentCount() - 1);

    makeFilterTable();

    // BGN LAYOUT
    filterTablePane.setBorder(BorderFactory.createEmptyBorder());
    rulePanel.setBorder(BorderFactory.createEmptyBorder());

    hSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, filterTablePane, tabbedPane);
    hSplitPane.setContinuousLayout(true);
    hSplitPane.setOneTouchExpandable(true);
    vSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, hSplitPane, refPanel);
    vSplitPane.setContinuousLayout(true);
    vSplitPane.setOneTouchExpandable(true);

    this.setLayout(new BorderLayout());
    this.add(vSplitPane, BorderLayout.CENTER);
    this.setBorder(BorderFactory.createEmptyBorder());
    vSplitPane.setBorder(BorderFactory.createEmptyBorder());
    hSplitPane.setBorder(BorderFactory.createEmptyBorder());
    resizePanes();
    // END LAYOUT

}

From source file:de.cismet.cids.custom.objecteditors.wunda_blau.WebDavPicturePanel.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.
 *//*  w  w  w .  j ava  2  s.c o m*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    GridBagConstraints gridBagConstraints;
    bindingGroup = new BindingGroup();

    final RoundedPanel pnlFotos = new RoundedPanel();
    final SemiRoundedPanel pnlHeaderFotos = new SemiRoundedPanel();
    final JLabel lblHeaderFotos = new JLabel();
    final JPanel jPanel2 = new JPanel();
    final JPanel jPanel1 = new JPanel();
    final JScrollPane jspFotoList = new JScrollPane();
    lstFotos = new JList();
    final JPanel pnlCtrlButtons = new JPanel();
    btnAddImg = new JButton();
    btnRemoveImg = new JButton();
    final JPanel pnlMap = new JPanel();
    final RoundedPanel pnlVorschau = new RoundedPanel();
    final SemiRoundedPanel semiRoundedPanel2 = new SemiRoundedPanel();
    final JLabel lblVorschau = new JLabel();
    final JPanel jPanel3 = new JPanel();
    pnlFoto = new JPanel();
    lblPicture = new JLabel();
    lblBusy = new JXBusyLabel(new Dimension(75, 75));
    final JPanel pnlCtrlBtn = new JPanel();
    btnPrevImg = new JButton();
    btnNextImg = new JButton();

    final FormListener formListener = new FormListener();

    setName("Form"); // NOI18N
    setOpaque(false);
    setLayout(new GridBagLayout());

    pnlFotos.setMinimumSize(new Dimension(400, 200));
    pnlFotos.setName("pnlFotos"); // NOI18N
    pnlFotos.setPreferredSize(new Dimension(400, 200));
    pnlFotos.setLayout(new GridBagLayout());

    pnlHeaderFotos.setBackground(new Color(51, 51, 51));
    pnlHeaderFotos.setForeground(new Color(51, 51, 51));
    pnlHeaderFotos.setName("pnlHeaderFotos"); // NOI18N
    pnlHeaderFotos.setLayout(new FlowLayout());

    lblHeaderFotos.setForeground(new Color(255, 255, 255));
    Mnemonics.setLocalizedText(lblHeaderFotos,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblHeaderFotos.text")); // NOI18N
    lblHeaderFotos.setName("lblHeaderFotos"); // NOI18N
    pnlHeaderFotos.add(lblHeaderFotos);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    pnlFotos.add(pnlHeaderFotos, gridBagConstraints);

    jPanel2.setName("jPanel2"); // NOI18N
    jPanel2.setOpaque(false);
    jPanel2.setLayout(new GridBagLayout());

    jPanel1.setName("jPanel1"); // NOI18N
    jPanel1.setOpaque(false);
    jPanel1.setLayout(new GridBagLayout());

    jspFotoList.setMinimumSize(new Dimension(250, 130));
    jspFotoList.setName("jspFotoList"); // NOI18N

    lstFotos.setMinimumSize(new Dimension(250, 130));
    lstFotos.setName("lstFotos"); // NOI18N
    lstFotos.setPreferredSize(new Dimension(250, 130));

    final ELProperty eLProperty = ELProperty.create("${cidsBean." + beanCollProp + "}");
    final JListBinding jListBinding = SwingBindings.createJListBinding(AutoBinding.UpdateStrategy.READ_WRITE,
            this, eLProperty, lstFotos);
    bindingGroup.addBinding(jListBinding);

    lstFotos.addListSelectionListener(formListener);
    jspFotoList.setViewportView(lstFotos);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    jPanel1.add(jspFotoList, gridBagConstraints);

    pnlCtrlButtons.setName("pnlCtrlButtons"); // NOI18N
    pnlCtrlButtons.setOpaque(false);
    pnlCtrlButtons.setLayout(new GridBagLayout());

    btnAddImg.setIcon(new ImageIcon(
            getClass().getResource("/de/cismet/cids/custom/objecteditors/wunda_blau/edit_add_mini.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnAddImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnAddImg.text")); // NOI18N
    btnAddImg.setBorderPainted(false);
    btnAddImg.setContentAreaFilled(false);
    btnAddImg.setName("btnAddImg"); // NOI18N
    btnAddImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.insets = new Insets(0, 0, 5, 0);
    pnlCtrlButtons.add(btnAddImg, gridBagConstraints);

    btnRemoveImg.setIcon(new ImageIcon(
            getClass().getResource("/de/cismet/cids/custom/objecteditors/wunda_blau/edit_remove_mini.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnRemoveImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnRemoveImg.text")); // NOI18N
    btnRemoveImg.setBorderPainted(false);
    btnRemoveImg.setContentAreaFilled(false);
    btnRemoveImg.setName("btnRemoveImg"); // NOI18N
    btnRemoveImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridy = 1;
    gridBagConstraints.insets = new Insets(5, 0, 0, 0);
    pnlCtrlButtons.add(btnRemoveImg, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.anchor = GridBagConstraints.NORTH;
    gridBagConstraints.insets = new Insets(0, 5, 0, 0);
    jPanel1.add(pnlCtrlButtons, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(10, 10, 10, 0);
    jPanel2.add(jPanel1, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(0, 0, 2, 0);
    pnlFotos.add(jPanel2, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.anchor = GridBagConstraints.NORTH;
    gridBagConstraints.insets = new Insets(0, 0, 5, 5);
    add(pnlFotos, gridBagConstraints);

    pnlMap.setBorder(BorderFactory.createEtchedBorder());
    pnlMap.setMinimumSize(new Dimension(400, 200));
    pnlMap.setName("pnlMap"); // NOI18N
    pnlMap.setPreferredSize(new Dimension(400, 200));
    pnlMap.setLayout(new BorderLayout());
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.VERTICAL;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(5, 0, 0, 5);
    add(pnlMap, gridBagConstraints);
    pnlMap.add(map, BorderLayout.CENTER);

    pnlVorschau.setName("pnlVorschau"); // NOI18N
    pnlVorschau.setLayout(new GridBagLayout());

    semiRoundedPanel2.setBackground(new Color(51, 51, 51));
    semiRoundedPanel2.setName("semiRoundedPanel2"); // NOI18N
    semiRoundedPanel2.setLayout(new FlowLayout());

    lblVorschau.setForeground(new Color(255, 255, 255));
    Mnemonics.setLocalizedText(lblVorschau,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblVorschau.text")); // NOI18N
    lblVorschau.setName("lblVorschau"); // NOI18N
    semiRoundedPanel2.add(lblVorschau);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    pnlVorschau.add(semiRoundedPanel2, gridBagConstraints);

    jPanel3.setName("jPanel3"); // NOI18N
    jPanel3.setOpaque(false);
    jPanel3.setLayout(new GridBagLayout());

    pnlFoto.setName("pnlFoto"); // NOI18N
    pnlFoto.setOpaque(false);
    pnlFoto.setLayout(new GridBagLayout());

    lblPicture.setHorizontalAlignment(SwingConstants.CENTER);
    Mnemonics.setLocalizedText(lblPicture,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblPicture.text")); // NOI18N
    lblPicture.setName("lblPicture"); // NOI18N
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlFoto.add(lblPicture, gridBagConstraints);

    lblBusy.setHorizontalAlignment(SwingConstants.CENTER);
    lblBusy.setMaximumSize(new Dimension(140, 40));
    lblBusy.setMinimumSize(new Dimension(140, 60));
    lblBusy.setName("lblBusy"); // NOI18N
    lblBusy.setPreferredSize(new Dimension(140, 60));
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlFoto.add(lblBusy, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(10, 10, 0, 10);
    jPanel3.add(pnlFoto, gridBagConstraints);

    pnlCtrlBtn.setName("pnlCtrlBtn"); // NOI18N
    pnlCtrlBtn.setOpaque(false);
    pnlCtrlBtn.setPreferredSize(new Dimension(100, 50));
    pnlCtrlBtn.setLayout(new GridBagLayout());

    btnPrevImg.setIcon(new ImageIcon(getClass().getResource("/res/arrow-left.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnPrevImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnPrevImg.text")); // NOI18N
    btnPrevImg.setBorderPainted(false);
    btnPrevImg.setFocusPainted(false);
    btnPrevImg.setName("btnPrevImg"); // NOI18N
    btnPrevImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlCtrlBtn.add(btnPrevImg, gridBagConstraints);

    btnNextImg.setIcon(new ImageIcon(getClass().getResource("/res/arrow-right.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnNextImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnNextImg.text")); // NOI18N
    btnNextImg.setBorderPainted(false);
    btnNextImg.setFocusPainted(false);
    btnNextImg.setName("btnNextImg"); // NOI18N
    btnNextImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlCtrlBtn.add(btnNextImg, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.insets = new Insets(0, 10, 10, 10);
    jPanel3.add(pnlCtrlBtn, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlVorschau.add(jPanel3, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new Insets(0, 5, 0, 0);
    add(pnlVorschau, gridBagConstraints);

    bindingGroup.bind();
}

From source file:com.unionpay.upmp.jmeterplugin.gui.UPMPUrlConfigGui.java

/**
 * Create a panel containing the webserver (domain+port) and timeouts (connect+request).
 *
 * @return the panel/*from w  w  w. j a  va2  s. com*/
 */
protected final JPanel getWebServerTimeoutPanel() {
    // WEB SERVER PANEL
    JPanel webServerPanel = new HorizontalPanel();
    webServerPanel.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), UPMPConstant.upmp_server)); // $NON-NLS-1$
    final JPanel domainPanel = getDomainPanel();
    final JPanel portPanel = getPortPanel();
    webServerPanel.add(domainPanel, BorderLayout.CENTER);
    webServerPanel.add(portPanel, BorderLayout.EAST);

    JPanel timeOut = new HorizontalPanel();
    timeOut.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
            UPMPConstant.upmp_server_timeout_title)); // $NON-NLS-1$
    final JPanel connPanel = getConnectTimeOutPanel();
    final JPanel reqPanel = getResponseTimeOutPanel();
    timeOut.add(connPanel);
    timeOut.add(reqPanel);

    JPanel webServerTimeoutPanel = new VerticalPanel();
    webServerTimeoutPanel.add(webServerPanel, BorderLayout.CENTER);
    webServerTimeoutPanel.add(timeOut, BorderLayout.EAST);

    JPanel bigPanel = new VerticalPanel();
    bigPanel.add(webServerTimeoutPanel);
    return bigPanel;
}

From source file:net.sf.jabref.gui.ContentSelectorDialog2.java

private void initLayout() {
    fieldNameField.setEnabled(false);/*w w w .  j  av  a 2  s . co m*/
    fieldList.setVisibleRowCount(4);
    wordList.setVisibleRowCount(10);
    final String VAL = "Uren luren himmelturen, ja Besseggen.";
    fieldList.setPrototypeCellValue(VAL);
    wordList.setPrototypeCellValue(VAL);

    fieldPan.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
            Localization.lang("Field name")));
    wordPan.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), Localization.lang("Keyword")));
    fieldPan.setLayout(gbl);
    wordPan.setLayout(gbl);
    con.insets = new Insets(2, 2, 2, 2);
    con.fill = GridBagConstraints.BOTH;
    con.gridwidth = 2;
    con.weightx = 1;
    con.weighty = 1;
    con.gridx = 0;
    con.gridy = 0;
    gbl.setConstraints(fPane, con);
    fieldPan.add(fPane);
    gbl.setConstraints(wPane, con);
    wordPan.add(wPane);
    con.gridwidth = 1;
    con.gridx = 2;
    //con.weightx = 0.7;
    con.gridheight = 2;
    gbl.setConstraints(fieldNamePan, con);
    fieldPan.add(fieldNamePan);
    gbl.setConstraints(wordEditPan, con);
    wordPan.add(wordEditPan);
    con.gridx = 0;
    con.gridy = 1;
    con.weightx = 0;
    con.weighty = 0;
    con.gridwidth = 1;
    con.gridheight = 1;
    con.fill = GridBagConstraints.NONE;
    con.anchor = GridBagConstraints.WEST;
    gbl.setConstraints(newField, con);
    fieldPan.add(newField);
    gbl.setConstraints(newWord, con);
    wordPan.add(newWord);
    con.gridx = 1;
    //con.anchor = GridBagConstraints.EAST;
    gbl.setConstraints(removeField, con);
    fieldPan.add(removeField);
    gbl.setConstraints(removeWord, con);
    wordPan.add(removeWord);
    con.anchor = GridBagConstraints.WEST;
    con.gridx = 0;
    con.gridy = 0;
    gbl.setConstraints(fieldNameField, con);
    fieldNamePan.add(fieldNameField);
    gbl.setConstraints(wordEditField, con);
    wordEditPan.add(wordEditField);

    // Add buttons:
    ButtonBarBuilder bsb = new ButtonBarBuilder(buttonPan);
    bsb.addGlue();
    bsb.addButton(ok);
    bsb.addButton(apply);
    bsb.addButton(cancel);
    bsb.addRelatedGap();
    bsb.addButton(new HelpAction(HelpFile.CONTENT_SELECTOR).getHelpButton());
    bsb.addGlue();

    // Add panels to dialog:
    con.fill = GridBagConstraints.BOTH;
    getContentPane().setLayout(gbl);
    con.weightx = 1;
    con.weighty = 0.5;
    con.gridwidth = 1;
    con.gridheight = 1;
    con.gridx = 0;
    con.gridy = 0;
    gbl.setConstraints(fieldPan, con);
    getContentPane().add(fieldPan);
    con.gridy = 1;
    gbl.setConstraints(wordPan, con);
    getContentPane().add(wordPan);
    con.weighty = 0;
    con.gridy = 2;
    con.insets = new Insets(12, 2, 2, 2);
    gbl.setConstraints(buttonPan, con);
    getContentPane().add(buttonPan);

}

From source file:com.mirth.connect.client.ui.editors.transformer.TransformerPane.java

/**
 * This method is called from within the constructor to initialize the form.
 *///from w w  w.ja  v a  2  s . c om
public void initComponents() {

    // the available panels (cards)
    stepPanel = new BasePanel();
    blankPanel = new BasePanel();

    scriptTextArea = new MirthRTextScrollPane(null, true, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, false);
    scriptTextArea.setBackground(new Color(204, 204, 204));
    scriptTextArea.setBorder(BorderFactory.createEtchedBorder());
    scriptTextArea.getTextArea().setEditable(false);
    scriptTextArea.getTextArea().setDropTarget(null);

    generatedScriptPanel = new JPanel();
    generatedScriptPanel.setBackground(Color.white);
    generatedScriptPanel.setLayout(new CardLayout());
    generatedScriptPanel.add(scriptTextArea, "");

    tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Step", stepPanel);

    tabbedPane.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            switchTab = (lastSelectedIndex == 0 && tabbedPane.getSelectedIndex() == 1) ? true : false;
            updateCodePanel(null);
        }
    });

    for (TransformerStepPlugin transformerStepPlugin : LoadedExtensions.getInstance()
            .getTransformerStepPlugins().values()) {
        transformerStepPlugin.initialize(this);
    }

    // establish the cards to use in the Transformer
    stepPanel.addCard(blankPanel, BLANK_TYPE);
    for (TransformerStepPlugin plugin : LoadedExtensions.getInstance().getTransformerStepPlugins().values()) {
        stepPanel.addCard(plugin.getPanel(), plugin.getPluginPointName());
    }
    transformerTablePane = new JScrollPane();
    transformerTablePane.setBorder(BorderFactory.createEmptyBorder());

    viewTasks = new JXTaskPane();
    viewTasks.setTitle("Mirth Views");
    viewTasks.setFocusable(false);
    viewTasks.add(initActionCallback("accept", "Return back to channel.",
            ActionFactory.createBoundAction("accept", "Back to Channel", "B"),
            new ImageIcon(Frame.class.getResource("images/resultset_previous.png"))));
    parent.setNonFocusable(viewTasks);
    viewTasks.setVisible(false);
    parent.taskPaneContainer.add(viewTasks, parent.taskPaneContainer.getComponentCount() - 1);

    transformerTasks = new JXTaskPane();
    transformerTasks.setTitle("Transformer Tasks");
    transformerTasks.setFocusable(false);

    transformerPopupMenu = new JPopupMenu();

    // add new step task
    transformerTasks.add(initActionCallback("addNewStep", "Add a new transformer step.",
            ActionFactory.createBoundAction("addNewStep", "Add New Step", "N"),
            new ImageIcon(Frame.class.getResource("images/add.png"))));
    JMenuItem addNewStep = new JMenuItem("Add New Step");
    addNewStep.setIcon(new ImageIcon(Frame.class.getResource("images/add.png")));
    addNewStep.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            addNewStep();
        }
    });
    transformerPopupMenu.add(addNewStep);

    // delete step task
    transformerTasks.add(initActionCallback("deleteStep", "Delete the currently selected transformer step.",
            ActionFactory.createBoundAction("deleteStep", "Delete Step", "X"),
            new ImageIcon(Frame.class.getResource("images/delete.png"))));
    JMenuItem deleteStep = new JMenuItem("Delete Step");
    deleteStep.setIcon(new ImageIcon(Frame.class.getResource("images/delete.png")));
    deleteStep.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            deleteStep();
        }
    });
    transformerPopupMenu.add(deleteStep);

    transformerTasks.add(initActionCallback("doImport", "Import a transformer from an XML file.",
            ActionFactory.createBoundAction("doImport", "Import Transformer", "I"),
            new ImageIcon(Frame.class.getResource("images/report_go.png"))));
    JMenuItem importTransformer = new JMenuItem("Import Transformer");
    importTransformer.setIcon(new ImageIcon(Frame.class.getResource("images/report_go.png")));
    importTransformer.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            doImport();
        }
    });
    transformerPopupMenu.add(importTransformer);

    transformerTasks.add(initActionCallback("doExport", "Export the transformer to an XML file.",
            ActionFactory.createBoundAction("doExport", "Export Transformer", "E"),
            new ImageIcon(Frame.class.getResource("images/report_disk.png"))));
    JMenuItem exportTransformer = new JMenuItem("Export Transformer");
    exportTransformer.setIcon(new ImageIcon(Frame.class.getResource("images/report_disk.png")));
    exportTransformer.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            doExport();
        }
    });
    transformerPopupMenu.add(exportTransformer);

    transformerTasks.add(initActionCallback("doValidate", "Validate the currently viewed script.",
            ActionFactory.createBoundAction("doValidate", "Validate Script", "V"),
            new ImageIcon(Frame.class.getResource("images/accept.png"))));
    JMenuItem validateStep = new JMenuItem("Validate Script");
    validateStep.setIcon(new ImageIcon(Frame.class.getResource("images/accept.png")));
    validateStep.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            doValidate();
        }
    });
    transformerPopupMenu.add(validateStep);

    // move step up task
    transformerTasks.add(initActionCallback("moveStepUp", "Move the currently selected step up.",
            ActionFactory.createBoundAction("moveStepUp", "Move Step Up", "P"),
            new ImageIcon(Frame.class.getResource("images/arrow_up.png"))));
    JMenuItem moveStepUp = new JMenuItem("Move Step Up");
    moveStepUp.setIcon(new ImageIcon(Frame.class.getResource("images/arrow_up.png")));
    moveStepUp.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            moveStepUp();
        }
    });
    transformerPopupMenu.add(moveStepUp);

    // move step down task
    transformerTasks.add(initActionCallback("moveStepDown", "Move the currently selected step down.",
            ActionFactory.createBoundAction("moveStepDown", "Move Step Down", "D"),
            new ImageIcon(Frame.class.getResource("images/arrow_down.png"))));
    JMenuItem moveStepDown = new JMenuItem("Move Step Down");
    moveStepDown.setIcon(new ImageIcon(Frame.class.getResource("images/arrow_down.png")));
    moveStepDown.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            moveStepDown();
        }
    });
    transformerPopupMenu.add(moveStepDown);

    // add the tasks to the taskpane, and the taskpane to the mirth client
    parent.setNonFocusable(transformerTasks);
    transformerTasks.setVisible(false);
    parent.taskPaneContainer.add(transformerTasks, parent.taskPaneContainer.getComponentCount() - 1);

    makeTransformerTable();

    // BGN LAYOUT
    transformerTable.setBorder(BorderFactory.createEmptyBorder());
    transformerTablePane.setBorder(BorderFactory.createEmptyBorder());
    transformerTablePane.setMinimumSize(new Dimension(0, 40));
    stepPanel.setBorder(BorderFactory.createEmptyBorder());

    hSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, transformerTablePane, tabbedPane);
    hSplitPane.setContinuousLayout(true);
    // hSplitPane.setDividerSize(6);
    hSplitPane.setOneTouchExpandable(true);
    vSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, hSplitPane, refPanel);
    // vSplitPane.setDividerSize(6);
    vSplitPane.setOneTouchExpandable(true);
    vSplitPane.setContinuousLayout(true);

    hSplitPane.setBorder(BorderFactory.createEmptyBorder());
    vSplitPane.setBorder(BorderFactory.createEmptyBorder());
    this.setLayout(new BorderLayout());
    this.add(vSplitPane, BorderLayout.CENTER);
    setBorder(BorderFactory.createEmptyBorder());
    resizePanes();
    // END LAYOUT

}

From source file:com.mirth.connect.connectors.doc.DocumentWriter.java

private void initComponents() {
    setBackground(UIConstants.BACKGROUND_COLOR);

    outputLabel = new JLabel("Output:");
    ButtonGroup outputButtonGroup = new ButtonGroup();

    outputFileRadioButton = new MirthRadioButton("File");
    outputFileRadioButton.setBackground(getBackground());
    outputFileRadioButton.setToolTipText("Write the contents to a file.");
    outputFileRadioButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            updateFileEnabled(true);//from   ww  w  .  j ava 2  s .c o m
        }
    });
    outputButtonGroup.add(outputFileRadioButton);

    outputAttachmentRadioButton = new MirthRadioButton("Attachment");
    outputAttachmentRadioButton.setBackground(getBackground());
    outputAttachmentRadioButton.setToolTipText(
            "<html>Write the contents to an attachment. The destination's response message will contain the<br>attachment Id and can be used in subsequent connectors to include the attachment.</html>");
    outputAttachmentRadioButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            updateFileEnabled(false);
        }
    });
    outputButtonGroup.add(outputAttachmentRadioButton);

    outputBothRadioButton = new MirthRadioButton("Both");
    outputBothRadioButton.setBackground(getBackground());
    outputBothRadioButton.setToolTipText(
            "<html>Write the contents to a file and an attachment. The destination's response message will contain<br>the attachment Id and can be used in subsequent connectors to include the attachment.</html>");
    outputBothRadioButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            updateFileEnabled(true);
        }
    });
    outputButtonGroup.add(outputBothRadioButton);

    directoryLabel = new JLabel("Directory:");

    directoryField = new MirthTextField();
    directoryField.setToolTipText("The directory (folder) where the generated file should be written.");

    testConnectionButton = new JButton("Test Write");
    testConnectionButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            testConnection();
        }
    });

    fileNameLabel = new JLabel("File Name:");
    fileNameField = new MirthTextField();
    fileNameField.setToolTipText("The file name to give to the generated file.");

    documentTypeLabel = new JLabel("Document Type:");
    ButtonGroup documentTypeButtonGroup = new ButtonGroup();

    documentTypePDFRadio = new MirthRadioButton("PDF");
    documentTypePDFRadio.setBackground(getBackground());
    documentTypePDFRadio.setToolTipText("The type of document to be created for each message.");
    documentTypePDFRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            documentTypePDFRadioActionPerformed();
        }
    });
    documentTypeButtonGroup.add(documentTypePDFRadio);

    documentTypeRTFRadio = new MirthRadioButton("RTF");
    documentTypeRTFRadio.setBackground(getBackground());
    documentTypeRTFRadio.setToolTipText("The type of document to be created for each message.");
    documentTypeRTFRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            documentTypeRTFRadioActionPerformed();
        }
    });
    documentTypeButtonGroup.add(documentTypeRTFRadio);

    encryptedLabel = new JLabel("Encrypted:");
    ButtonGroup encryptedButtonGroup = new ButtonGroup();

    encryptedYesRadio = new MirthRadioButton("Yes");
    encryptedYesRadio.setBackground(getBackground());
    encryptedYesRadio.setToolTipText(
            "If Document Type PDF is selected, generated documents can optionally be encrypted.");
    encryptedYesRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            encryptedYesActionPerformed();
        }
    });
    encryptedButtonGroup.add(encryptedYesRadio);

    encryptedNoRadio = new MirthRadioButton("No");
    encryptedNoRadio.setBackground(getBackground());
    encryptedNoRadio.setToolTipText(
            "If Document Type PDF is selected, generated documents can optionally be encrypted.");
    encryptedNoRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            encryptedNoActionPerformed();
        }
    });
    encryptedButtonGroup.add(encryptedNoRadio);

    passwordLabel = new JLabel("Password:");
    passwordField = new MirthPasswordField();
    passwordField.setToolTipText(
            "If Encrypted Yes is selected, enter the password to be used to later view the document here.");

    pageSizeLabel = new JLabel("Page Size:");
    pageSizeXLabel = new JLabel("");

    DocumentListener pageSizeDocumentListener = new DocumentListener() {
        @Override
        public void removeUpdate(DocumentEvent evt) {
            updatePageSizeComboBox();
        }

        @Override
        public void insertUpdate(DocumentEvent evt) {
            updatePageSizeComboBox();
        }

        @Override
        public void changedUpdate(DocumentEvent evt) {
            updatePageSizeComboBox();
        }
    };

    pageSizeWidthField = new MirthTextField();
    pageSizeWidthField.getDocument().addDocumentListener(pageSizeDocumentListener);
    pageSizeWidthField.setToolTipText(
            "<html>The width of the page. The units for the width<br/>are determined by the drop-down menu to the right.<br/>When rendering PDFs, a minimum of 26mm is enforced.</html>");

    pageSizeHeightField = new MirthTextField();
    pageSizeHeightField.getDocument().addDocumentListener(pageSizeDocumentListener);
    pageSizeHeightField.setToolTipText(
            "<html>The height of the page. The units for the height<br/>are determined by the drop-down menu to the right.<br/>When rendering PDFs, a minimum of 26mm is enforced.</html>");

    pageSizeUnitComboBox = new MirthComboBox<Unit>();
    pageSizeUnitComboBox.setModel(new DefaultComboBoxModel<Unit>(Unit.values()));
    pageSizeUnitComboBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            updatePageSizeComboBox();
        }
    });
    pageSizeUnitComboBox.setToolTipText("The units to use for the page width and height.");

    pageSizeComboBox = new MirthComboBox<PageSize>();
    pageSizeComboBox.setModel(new DefaultComboBoxModel<PageSize>(
            ArrayUtils.subarray(PageSize.values(), 0, PageSize.values().length - 1)));
    pageSizeComboBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            pageSizeComboBoxActionPerformed();
        }
    });
    pageSizeComboBox.setToolTipText("Select a standard page size to use, or enter a custom page size.");

    templateLabel = new JLabel("HTML Template:");
    templateTextArea = new MirthRTextScrollPane(ContextType.DESTINATION_DISPATCHER, false,
            SyntaxConstants.SYNTAX_STYLE_HTML, false);
    templateTextArea.setBorder(BorderFactory.createEtchedBorder());
}