Esempio n. 1
5
  public SoundFontViewer() {
    this.setLayout(new BorderLayout());
    JSplitPane split = new JSplitPane();
    this.add(split, BorderLayout.CENTER);

    FileTree fTree = new FileTree();

    fTree.setMinimumSize(new Dimension(0, 0));

    String[] filters = {".sf2"};

    fTree.setFilters(filters);

    fTree.addFileTreeListener(this::getSoundFontInfo);

    fTree.addFileTreePopup(new SFFileTreePopup());

    JTabbedPane tabs = new JTabbedPane();

    JScrollPane scrollInstrument = new JScrollPane();
    scrollInstrument.setBorder(null);
    scrollInstrument.setViewportView(instrumentInfo);

    JScrollPane scrollPreset = new JScrollPane();
    scrollPreset.setBorder(null);
    scrollPreset.setViewportView(presetInfo);

    tabs.add("Instruments", scrollInstrument);
    tabs.add("Presets", scrollPreset);

    split.add(fTree, JSplitPane.LEFT);
    split.add(tabs, JSplitPane.RIGHT);

    split.setDividerLocation(200);
  }
Esempio n. 2
0
  void initialize() {
    BeanTreeView left;
    left = new BeanTreeView();
    left.setRootVisible(false);

    PropertySheetView right;
    right = new PropertySheetView();
    right.setDescriptionAreaVisible(false);

    JSplitPane splitPane;
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left, right);
    splitPane.setResizeWeight(0.4);
    splitPane.setDividerSize(3);

    setTitle("Splunk Explorer");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    getContentPane().add(splitPane);

    // Place the window in a convenient position
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    int width = screenSize.width / 2;
    int height = screenSize.height / 2;
    setSize(width, height);
    setLocation(width / 2, height / 2);
  }
 private void addSidePane() {
   getContentPane().remove(mainPane);
   splitPane.setRightComponent(mainPane);
   getContentPane().add(splitPane);
   int i = preferences().getIntProperty("InstrumentsDbFrame.dividerLocation");
   if (i != 0) splitPane.setDividerLocation(i);
 }
  /** Arg Constructor */
  public TicTacToeFrame() {

    // Creates a panel for grid layout
    // http://www.java-tips.org/java-se-tips-100019/15-javax-swing/1751-how-to-make-split-pane-using-swing8.html
    JPanel gameBoardPanel = new JPanel(new GridLayout(3, 3, 0, 0)); // panel 1
    JPanel gameStatusPanel = new JPanel(); // panel 2

    // JLabel gameStatusLabel = new JLabel("Area 2");
    // gameBoardPanel.add(j1);
    gameStatusPanel.add(gameStatusLabel2);
    gameStatusPanel.add(gameStatusLabel3);
    gameStatusPanel.add(gameStatusLabel);
    JSplitPane splitPane =
        new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, gameBoardPanel, gameStatusPanel);
    splitPane.setResizeWeight(0.9);
    splitPane.setOneTouchExpandable(true);
    getContentPane().add(splitPane);

    // Adds 9 cells to grid layout
    for (int i = 0; i < 3; i++) {
      for (int k = 0; k < 3; k++) {
        gameBoardPanel.add(cells[i][k] = new Cell());
      }
    }
  }
 public CFAccSwingSecGroupFormViewEditJPanel(
     ICFAccSwingSchema argSchema, ICFSecuritySecGroupFormObj argFocus) {
   super();
   final String S_ProcName = "construct-schema-focus";
   if (argSchema == null) {
     throw CFLib.getDefaultExceptionFactory()
         .newNullArgumentException(getClass(), S_ProcName, 1, "argSchema");
   }
   // argFocus is optional; focus may be set later during execution as
   // conditions of the runtime change.
   swingSchema = argSchema;
   setSwingFocus(argFocus);
   setSize(1024, 480);
   splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
   attrJPanel = argSchema.getSecGroupFormFactory().newAttrJPanel(argFocus);
   attrScrollPane = new CFHSlaveJScrollPane(attrJPanel);
   eltJTabbedPane = argSchema.getSecGroupFormFactory().newEltJTabbedPane(argFocus);
   splitPane.setTopComponent(attrScrollPane);
   splitPane.setBottomComponent(eltJTabbedPane);
   add(splitPane);
   splitPane.setBounds(0, 0, 1024, 455);
   splitPane.setDividerLocation(200);
   if (getSwingFocus() != null) {
     setPanelMode(CFJPanel.PanelMode.View);
   }
   doLayout();
 }
Esempio n. 6
0
  /** Prepares a new <code>MainPanel</code> object. */
  public MainPanel() {
    super(new BorderLayout());
    // TODO: not new Host() but null
    final TerminalPanel terminalPanel = new TerminalPanel(new Host());
    final JSplitPane splitPane =
        new JSplitPane(JSplitPane.VERTICAL_SPLIT, new ClustersPanel(), terminalPanel);
    Tools.getGUIData().setTerminalSplitPane(splitPane);

    splitPane.setContinuousLayout(true);
    splitPane.setResizeWeight(1);
    splitPane.setOneTouchExpandable(true);

    splitPane.addHierarchyListener(
        new HierarchyListener() {
          public void hierarchyChanged(final HierarchyEvent e) {
            mExpanding.lock();
            if (!expandingDone && (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {

              expandingDone = true;
              mExpanding.unlock();
              Tools.getGUIData().expandTerminalSplitPane(1);
            } else {
              mExpanding.unlock();
            }
          }
        });
    add(splitPane, BorderLayout.CENTER);
  }
Esempio n. 7
0
  public CodeServerGui() {
    super("XApi Codeserver");
    BorderLayout layout = new BorderLayout(5, 5);
    setLayout(layout);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 500, 300);
    //    setAlwaysOnTop(true);
    test = new SingleFileSelector("Set Work Directory");
    test.setToolTipText(
        "The working directory where gwt codeserver will write compiles.  Defaults to "
            + tmpConfig.getParent());
    test.setChooserType(JFileChooser.DIRECTORIES_ONLY);
    try {
      test.setFile(tmpConfig.getParentFile());
    } catch (Exception e) {
      X_Log.warn(getClass(), "Error loading file ", tmpConfig.getParentFile(), e);
    }
    add(test, BorderLayout.NORTH);
    controls =
        new CodeServerControls(
            new Runnable() {
              @Override
              public void run() {
                launchServer(isUseTestSources(), "JS", getLogLevel());
              }
            });
    add(controls, BorderLayout.SOUTH);
    logger =
        new ProcessLog() {
          Runnable recalc;

          @Override
          public void invalidate() {
            super.invalidate();
            if (null == recalc) {
              recalc =
                  new Runnable() {
                    @Override
                    public void run() {
                      recalc = null;
                      CodeServerGui.this.validate();
                    }
                  };
              SwingUtilities.invokeLater(recalc);
            }
          }
        };
    sources = new SourcesSelector("Gwt Sources", logger);
    JScrollPane wrap =
        new JScrollPane(
            logger,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    JSplitPane splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splitter.setLeftComponent(sources);
    splitter.setRightComponent(wrap);
    splitter.setResizeWeight(0.5);
    add(splitter, BorderLayout.CENTER);
    //    add(logger,BorderLayout.EAST);
  }
Esempio n. 8
0
  public SplitPaneDemo() {

    // Create the list of images and put it in a scroll pane.

    list = new JList(imageNames);
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    list.setSelectedIndex(0);
    list.addListSelectionListener(this);

    JScrollPane listScrollPane = new JScrollPane(list);
    picture = new JLabel();
    picture.setFont(picture.getFont().deriveFont(Font.ITALIC));
    picture.setHorizontalAlignment(JLabel.CENTER);

    JScrollPane pictureScrollPane = new JScrollPane(picture);

    // Create a split pane with the two scroll panes in it.
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listScrollPane, pictureScrollPane);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(150);

    // Provide minimum sizes for the two components in the split pane.
    Dimension minimumSize = new Dimension(100, 50);
    listScrollPane.setMinimumSize(minimumSize);
    pictureScrollPane.setMinimumSize(minimumSize);

    // Provide a preferred size for the split pane.
    splitPane.setPreferredSize(new Dimension(400, 200));
    updateLabel(imageNames[list.getSelectedIndex()]);
  }
Esempio n. 9
0
  /** Show the errorPane for error output */
  private void showErrorPane() {
    if (errorShown) {
      return;
    }

    // the first time the errortext is shown we need to pack() it
    // to make it have the right size.
    boolean isFirstShow = false;
    if (errorText == null) {
      isFirstShow = true;
      createErrorPane();
    }

    getContentPane().remove(scrollPane);

    // We want to know if it is not the first time
    // This means a "clear" has been used to remove the splitpane
    // when this re-adds the scrollPane to the terminal area
    // it implicitly removes it from the splitpane as it can only have one
    // owner. The side-effect of this is the splitpane's
    // top component becomes null.
    if (!isFirstShow) splitPane.setTopComponent(scrollPane);
    getContentPane().add(splitPane, BorderLayout.CENTER);
    splitPane.resetToPreferredSizes();

    if (isFirstShow) {
      pack();
    } else {
      validate();
    }

    errorShown = true;
  }
  public PrinterStatusPanel(Executor exe) {
    this.exe = exe;
    myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.PAGE_AXIS));
    myPanel.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createLineBorder(Color.black), "Printer Status"));

    // Temperature plot
    tempPanel = new TemperaturePanel(exe);

    // Text Area for Log Messages
    statusText.setEditable(false);
    statusText.setFont(new Font(Font.MONOSPACED, Font.PLAIN, FONT_SIZE));
    statusText.setLineWrap(false);
    statusText.setText(OFFLINE_MESSAGE);
    final DefaultCaret caret = (DefaultCaret) statusText.getCaret();
    caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
    scrollPane = new JScrollPane(statusText);
    scrollPane.setViewportView(statusText);

    final JSplitPane splitPane =
        new JSplitPane(JSplitPane.VERTICAL_SPLIT, tempPanel.getPanel(), scrollPane);
    splitPane.setDividerLocation(300);
    myPanel.add(splitPane);
    GuiAppender.setTextArea(statusText);
  }
Esempio n. 11
0
  public void displayMessage() {
    saveState();

    messageTreeTable.hided();
    draftPanel.hided();

    if (gmailView) mainSplit.setRightComponent(messagePanel.getPanel());
    else rightSplit.setRightComponent(messagePanel.getPanel());

    messagePanel.redisplayed();
    // mainSplit.validate();

    if (messagePanel.getMessage() != null && !messagePanel.getMessage().isRead()) {
      messagePanel.getMessage().setRead(true);

      int row = messageTreeTable.getRow(messagePanel.getMessage());

      if (row >= 0) messageTreeTable.refresh(row);
      else messageTreeTable.refresh();

      boardTree.refresh(messagePanel.getMessage().getBoard());
    }

    messagePanel.redisplayed();

    loadState();
  }
Esempio n. 12
0
  public SHCEEMain() {
    super();
    mySHCEEMain = this;

    initializeMainFrame();

    valueEditor = new ValueEditorPanel();
    deviceSelector = new DeviceSelectorPanel();

    jSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    jSplitPane.add(deviceSelector);
    jSplitPane.add(valueEditor);

    add(jSplitPane);

    ComponentListener resizeListener =
        new ComponentAdapter() {
          public void componentResized(ComponentEvent e) {
            onResize();
          }
        };

    addComponentListener(resizeListener);

    jSplitPane.setDividerLocation(defaultWidth * 45 / 100);
  }
 private MyWindow(@Nonnull Class<?> testClass) {
   super(testClass);
   splitPane.setName("slideMeSplitPane");
   splitPane.setLeftComponent(list("One", "Two"));
   splitPane.setRightComponent(list("Three"));
   addComponents(splitPane);
 }
  private void initView() {
    AutomatonEditorPanel<T, S> panel = getEditorPanel();
    T auto = panel.getAutomaton();

    initTable(myAlg.getConvertedGrammar(), new UndoKeeper());
    panel.setTool(createArrowTool(panel, auto));

    MagnifiableScrollPane scroll = new MagnifiableScrollPane(myTable);
    scroll.setMinimumSize(myTable.getMinimumSize());

    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panel, scroll);

    Dimension size = getPreferredSize(), scrollSize = myTable.getMinimumSize();
    double width = size.width + scrollSize.width;
    split.setPreferredSize(new Dimension((int) width, size.height));

    double ratio = size.width / width;
    split.setDividerLocation(ratio);
    split.setResizeWeight(ratio);

    SizeSlider slider = new SizeSlider(scroll);
    JToolBar toolbar = initToolbar();

    add(split, BorderLayout.CENTER);
    add(slider, BorderLayout.SOUTH);
    add(toolbar, BorderLayout.NORTH);

    slider.distributeMagnification();

    size =
        new Dimension(
            (int) width,
            size.height + slider.getPreferredSize().height + toolbar.getPreferredSize().height);
    setPreferredSize(size);
  }
Esempio n. 15
0
 /** Update all the store-able properties to their current values */
 public void updateProperties() {
   // Kept up-to-date with event listeners
   // Manager.actorDetails.visible
   // Manager.groupTable.autoResize
   propertyBag.setProperty(
       "Manager.splitHorizontal.dividerLocation",
       String.valueOf(jSplitPaneHorizontal.getDividerLocation()));
   propertyBag.setProperty(
       "Manager.splitVertical.dividerLocation",
       String.valueOf(jSplitPaneVertical.getDividerLocation()));
   propertyBag.setProperty("Manager.location.x", String.valueOf(getLocation().x));
   propertyBag.setProperty("Manager.location.y", String.valueOf(getLocation().y));
   propertyBag.setProperty("Manager.size.width", String.valueOf(getSize().width));
   propertyBag.setProperty("Manager.size.height", String.valueOf(getSize().height));
   propertyBag.setProperty(
       "Manager.groupFileChooser.defaultLocation",
       groupFileChooser.getCurrentDirectory().getPath());
   propertyBag.setProperty(
       "Manager.gcaFileChooser.defaultLocation", gcaFileChooser.getCurrentDirectory().getPath());
   // Optional properties
   if (saveAsFile != null) {
     propertyBag.setProperty("Manager.currentLoadedFile", saveAsFile.getAbsolutePath());
   } else {
     propertyBag.remove("Manager.currentLoadedFile");
   }
   groupTable.updateProperties(); // Update properties for the table
 }
  public LibraryMediator() {
    GUIMediator.setSplashScreenString(I18n.tr("Loading Library Window..."));

    idScanned = new HashSet<Integer>();

    getComponent(); // creates MAIN_PANEL

    scrollbarValues = new HashMap<Object, Integer>();

    splitPane =
        new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, getLibraryLeftPanel(), getLibraryRightPanel());
    splitPane.setContinuousLayout(true);
    splitPane.setResizeWeight(0.5);
    splitPane.addPropertyChangeListener(
        JSplitPane.LAST_DIVIDER_LOCATION_PROPERTY,
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent evt) {
            JSplitPane splitPane = (JSplitPane) evt.getSource();
            int current = splitPane.getDividerLocation();
            if (current > LibraryLeftPanel.MAX_WIDTH) {
              splitPane.setDividerLocation(LibraryLeftPanel.MAX_WIDTH);
            } else if (current < LibraryLeftPanel.MIN_WIDTH) {
              splitPane.setDividerLocation(LibraryLeftPanel.MIN_WIDTH);
            }
          }
        });

    DividerLocationSettingUpdater.install(splitPane, UISettings.UI_LIBRARY_MAIN_DIVIDER_LOCATION);

    MAIN_PANEL.add(splitPane);

    DeviceDiscoveryClerk clerk = new DeviceDiscoveryClerk();
    clerk.start();
  }
Esempio n. 17
0
  private void initGUI() {

    this.setTitle("Notizen");
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.lp, this.np);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(200);

    // Provide minimum sizes for the two components in the split pane
    Dimension minimumSize = new Dimension(200, 100);
    this.lp.setMinimumSize(minimumSize);
    this.np.setMinimumSize(minimumSize);

    this.setLayout(new BorderLayout());

    this.addWindowListener(this.c);

    this.setSize(700, 400);
    this.setLocationRelativeTo(null);

    this.add(splitPane, BorderLayout.CENTER);

    this.setVisible(true);
  }
Esempio n. 18
0
  /**
   * Constructor
   *
   * @param mt Map transform
   * @param type Layer geometry type
   * @param layer Layer
   * @param style Style
   */
  public SimpleStyleEditor(MapTransform mt, Type type, ILayer layer, Style style) {
    // Set the layout.
    super(new BorderLayout());

    // Recover the first three paramters.
    this.mt = mt;
    this.type = type;
    this.layer = layer;

    // Get the geometry type and available legends.
    this.geometryType =
        (type == null) ? SimpleGeometryType.ALL : SimpleGeometryType.getSimpleType(type);

    // Initialize the dialog container, adding the empty dialog.
    cardLayout = new CardLayout();
    dialogContainer = new JPanel(cardLayout);
    dialogContainer.setPreferredSize(new Dimension(640, 420));
    addEmptyDialog();

    // Add all panels.
    styleWrapper = addAllPanels(style);

    // Initialize the legend tree.
    legendTree = new LegendTree(this);

    // Put everything inside a split pane.
    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, legendTree, dialogContainer);
    // Should be just wide enough for "Interval classification - Point"
    splitPane.setDividerLocation(260);
    Dimension minimumSize = new Dimension(100, 50);
    legendTree.setMinimumSize(minimumSize);
    dialogContainer.setMinimumSize(minimumSize);
    add(splitPane, BorderLayout.CENTER);
  }
Esempio n. 19
0
  public void initializeHelp() {
    try {
      // Create the nodes.
      DefaultMutableTreeNode top = new DefaultMutableTreeNode("INFORMATION MANAGEMENT SYSTEM HELP");
      createNodes(top);

      // Create a tree that allows one selection at a time.
      tree = new JTree(top);
      tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

      // Listen for when the selection changes.
      tree.addTreeSelectionListener(this);

      if (playWithLineStyle) {
        System.out.println("line style = " + lineStyle);
        tree.putClientProperty("JTree.lineStyle", lineStyle);
      }

      // Create the scroll pane and add the tree to it.
      JScrollPane treeView = new JScrollPane(tree);

      // Create the HTML viewing pane.
      htmlPane = new JEditorPane();
      htmlPane.setEditable(false);
      initHelp();
      JScrollPane htmlView = new JScrollPane(htmlPane);

      splitPane.setLeftComponent(treeView);
      splitPane.setRightComponent(htmlView);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Esempio n. 20
0
  public LogFilesTab() {

    _localFileSystem
        .getFileTree()
        .getSelectionModel()
        .addListSelectionListener(new LogSelectionListener(_localFileSystem.getFileTree()));

    this.setLayout(new GridBagLayout());
    GridBagConstraints cons = new GridBagConstraints();

    this.addComponentListener(this);

    _outerSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);

    _outerSplitPane.setLeftComponent(getLocalFileSystemPanel());
    _outerSplitPane.setRightComponent(_middlePanel);

    cons.fill = GridBagConstraints.BOTH;
    cons.weightx = 1.0;
    cons.weighty = 1.0;

    // same weight for each size
    _outerSplitPane.setResizeWeight(0.5);

    this.add(_outerSplitPane, cons);

    // makes each side with same desired size so that the split happens exactly in the middle
    this.getLocalFileSystemPanel().setPreferredSize(_middlePanel.getPreferredSize());
  }
Esempio n. 21
0
 private JSplitPane createMessageLedgerSplitter(JScrollPane ledger, RvDetailsPanel details) {
   final JSplitPane splitter = new JSplitPane(JSplitPane.VERTICAL_SPLIT, ledger, details);
   splitter.setOneTouchExpandable(true);
   splitter.setDividerLocation(0.5);
   splitter.setBorder(BorderFactory.createEmptyBorder());
   return splitter;
 }
Esempio n. 22
0
  /**
   * Creates a tileset editor.
   *
   * @param mainWindow The main window of the quest editor.
   * @param tileset Id of the tileset to open.
   * @throws QuestEditorException If the tileset could not be loaded.
   */
  public TilesetEditorPanel(EditorWindow mainWindow, String tilesetId) throws QuestEditorException {
    super(mainWindow, getEditorId(tilesetId));

    setLayout(new BorderLayout());

    // tile patterns list and tileset image

    // tile patterns list
    tilePatternsView = new TilePatternsView();
    tilePatternsView.setAlignmentY(Component.TOP_ALIGNMENT);
    tilePatternsView.setPreferredSize(new Dimension(200, Integer.MAX_VALUE));
    tilePatternsView.setMinimumSize(new Dimension(0, 0));

    // tileset image
    tilesetImageView = new TilesetImageView(true);
    JScrollPane tilesetImageScroller = new JScrollPane(tilesetImageView);
    tilesetImageScroller.setAlignmentY(Component.TOP_ALIGNMENT);

    JSplitPane tilesetPanel =
        new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tilePatternsView, tilesetImageScroller);
    tilesetPanel.setContinuousLayout(true);
    tilesetPanel.setDividerLocation(400);
    // we must put our main panel in another panel
    // otherwise the background color of the window is bad
    add(tilesetPanel);

    tileset = new Tileset(tilesetId);

    // Notify the children views.
    tilePatternsView.setTileset(tileset);
    tilesetImageView.setTileset(tileset);
  }
 public void doLayout() {
   Dimension sz = getSize();
   splitPane.setBounds(0, 0, sz.width, sz.height);
   splitPane.doLayout();
   attrScrollPane.doLayout();
   eltJTabbedPane.doLayout();
 }
  /** Default constructor */
  BuildOutputViewerMainPanel() {
    super(new BorderLayout());

    this.openedBuildOutputFrames = new LinkedHashMap<BuildOutput, JInternalFrame>();

    JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    JSplitPanes.setDividerLocation(mainSplitPane, 0.2);

    JPanel overviewPanel = new JPanel(new BorderLayout());
    JPanel overviewControlPanel = new JPanel(new GridLayout(0, 1));
    overviewControlPanel.add(new JCheckBox(hideSkippedBuildsAction));
    overviewControlPanel.add(new JCheckBox(hideBuildsWithoutMessagesAction));
    overviewControlPanel.add(new JCheckBox(hideBuildsWithoutIncludesAction));
    overviewPanel.add(overviewControlPanel, BorderLayout.NORTH);
    createProjectsTable();
    overviewPanel.add(new JScrollPane(projectsTable), BorderLayout.CENTER);
    mainSplitPane.setLeftComponent(overviewPanel);

    desktopPane = new JDesktopPane();
    mainSplitPane.setRightComponent(desktopPane);

    add(mainSplitPane, BorderLayout.CENTER);

    updateProjectsTableFilter();
  }
Esempio n. 25
0
    public HttpClientFrame() {
      client = new HttpClient(new MultiThreadedHttpConnectionManager());
      client.getHttpConnectionManager().getParams().setConnectionTimeout(30000);

      JPanel panInput = new JPanel(new FlowLayout());

      String[] aURLs = {
        "http://www.apache.org/",
        "http://www.google.com/",
        "http://www.opensource.org/",
        "http://www.anybrowser.org/",
        "http://jakarta.apache.org/",
        "http://www.w3.org/"
      };

      final JButton btnGET = new JButton("GET");
      btnGET.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
              String url = (String) cmbURL.getSelectedItem();
              if (url != null && url.length() > 0) {
                loadPage(url);
              }
            }
          });

      cmbURL = new JComboBox(aURLs);
      cmbURL.setToolTipText("Enter a URL");
      cmbURL.setEditable(true);
      cmbURL.setSelectedIndex(0);

      JLabel lblURL = new JLabel("URL:");

      panInput.add(lblURL);
      panInput.add(cmbURL);
      panInput.add(btnGET);

      taTextResponse = new JTextArea();
      taTextResponse.setEditable(false);
      taTextResponse.setCaretPosition(0);

      htmlPane = new JEditorPane();
      htmlPane.setContentType("text/html");
      htmlPane.setEditable(false);

      JSplitPane splitResponsePane =
          new JSplitPane(
              JSplitPane.HORIZONTAL_SPLIT,
              new JScrollPane(taTextResponse),
              new JScrollPane(htmlPane));
      splitResponsePane.setOneTouchExpandable(false);
      splitResponsePane.setDividerLocation(350);
      // it would be better to set resizeWeight, but this method does
      // not exist in JRE 1.2.2
      //            splitResponsePane.setResizeWeight(0.5);

      this.getContentPane().setLayout(new BorderLayout());
      this.getContentPane().add(panInput, BorderLayout.NORTH);
      this.getContentPane().add(splitResponsePane, BorderLayout.CENTER);
    }
Esempio n. 26
0
 public static JSplitPane createSplitPane(
     int splitOrientation, Component comp1, Component comp2, int divider) {
   JSplitPane js = new JSplitPane(splitOrientation, comp1, comp2);
   js.setOneTouchExpandable(true);
   js.setDividerLocation(divider);
   return js;
 }
Esempio n. 27
0
  public TriggerPanel(TriggersPackage pak, T trigger) {
    super(new BorderLayout());

    this.pak = pak;
    this.trigger = trigger;

    this.tree_root = new DefaultMutableTreeNode(trigger.getName());
    this.group_events = new TriggerEventRoot();
    this.group_conditions = new TriggerConditionsRoot();
    this.group_actions = new TriggerActionRoot();
    this.tree_root.add(group_events);
    this.tree_root.add(group_conditions);
    this.tree_root.add(group_actions);

    this.tree_view = new TriggerTreeView();

    this.comment.setText(trigger.comment);

    split.setTopComponent(split_h);
    split.setBottomComponent(south_h);

    JScrollPane left = new JScrollPane(tree_view);
    left.setMinimumSize(new Dimension(200, 120));
    split_h.setLeftComponent(left);
    split_h.setRightComponent(new JScrollPane(comment));
    split_h.setMinimumSize(new Dimension(200, 160));

    tree_view.expandAll();

    this.add(split);
    super.addAncestorListener(this);
  }
  /** Create the GUI components and layout. */
  private void init() { // called from ctor, so must not be overridable
    menuBar = new ReportMenuBar();
    setJMenuBar(menuBar);

    JPanel all = new JPanel(new BorderLayout());
    all.add(createToolBar(), BorderLayout.NORTH);

    JSplitPane treeAndMain = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);

    treePanel = createTreePanel();
    treeAndMain.setLeftComponent(treePanel);

    mainPanel = createMainPanel();
    treeAndMain.setRightComponent(mainPanel);

    treeAndMain.setResizeWeight(.2);
    treeAndMain.setContinuousLayout(true);
    all.add(treeAndMain, BorderLayout.CENTER);

    getContentPane().add(all);

    tree.setSelectionRow(1);
    addWindowListener(new WindowHappenings());

    setTitle(DEFAULT_TITLE);
    setIconImage(JMeterUtils.getImage("jmeter.jpg").getImage()); // $NON-NLS-1$
  }
  private Component createTabSplitPane() {
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);

    JPanel panel = new JPanel(new MigLayout("fill"));
    splitPane.setTopComponent(panel);
    JTextField textField = new JTextField();
    textField.setColumns(15);
    panel.add(textField);

    on(new JTextFieldDocumentChangedTrigger(textField)) //
        .read(new JTextFieldTextProvider(textField)) //
        .check(new StringNotEmptyRule()) //
        .handleWith(new IconBooleanFeedback(textField)) //
        .trigger();

    panel = new JPanel(new MigLayout("fill"));
    splitPane.setBottomComponent(panel);
    textField = new JTextField();
    textField.setColumns(15);
    panel.add(textField);

    on(new JTextFieldDocumentChangedTrigger(textField)) //
        .read(new JTextFieldTextProvider(textField)) //
        .check(new StringNotEmptyRule()) //
        .handleWith(new IconBooleanFeedback(textField)) //
        .trigger();

    return splitPane;
  }
Esempio n. 30
0
  public void initFenster() {
    // SplitPane
    JSplitPane splitPane = new JSplitPane();
    getContentPane().add(splitPane, BorderLayout.CENTER);
    JScrollPane scrollPane = new JScrollPane();
    splitPane.setLeftComponent(scrollPane);

    // Weinpanel
    weinpanel = new Weinpanel(this, betrieb);
    splitPane.setRightComponent(weinpanel);

    // Weinliste
    weinlist = new JList<Weine>(weinModel);
    weinlist.setFont(new Font("Tahoma", Font.PLAIN, 15));
    weinlist.setBorder(new EmptyBorder(0, 0, 0, 100));
    scrollPane.setViewportView(weinlist);
    weinlist.addListSelectionListener(
        new ListSelectionListener() {
          @Override
          public void valueChanged(ListSelectionEvent arg0) {
            doWeineValueChanged(arg0);
          }
        });

    // Label Header
    JLabel lblHeader = new JLabel("alle Weine");
    lblHeader.setFont(new Font("Tahoma", Font.BOLD, 15));
    scrollPane.setColumnHeaderView(lblHeader);
  }