示例#1
0
  // Create the primary panel with sub panels.
  private void createMainPanel() {

    // Create the panels in each tab.
    JPanel capturePanel = createCapturePanel();
    JPanel replayPanel = createReplayPanel();

    // Create the tabs and add the new panels to them.
    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Capture", capturePanel);
    tabbedPane.addTab("Replay", replayPanel);

    // Create the buttons that always show to select app.
    JPanel topButtons = new JPanel();
    topButtons.setLayout(new BoxLayout(topButtons, BoxLayout.X_AXIS));
    JButton selectApp = new JButton("Select Application");
    JLabel selectedApp = new JLabel("Selected App: ");
    appName = new JLabel();
    topButtons.add(selectApp);
    topButtons.add(Box.createRigidArea(new Dimension(10, 0)));
    topButtons.add(selectedApp);
    topButtons.add(appName);

    selectApp.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            displayAppFrame();
          }
        });

    // Add the buttons and tab structure.
    add(topButtons, BorderLayout.NORTH);
    add(tabbedPane, BorderLayout.CENTER);
  }
  // Constructor
  public ParticleGeneratePanel(ParticleList particleList, UintahGui parent) {

    // Copy the arguments
    d_particleList = particleList;

    // Initialize particle size distribution
    d_partSizeDist = new ParticleSize();

    // Create the tabbed pane
    partTabbedPane = new JTabbedPane();

    // Create the panels to be added to the tabbed pane
    particleSizeInputPanel = new ParticleSizeDistInputPanel(d_partSizeDist, this);
    particleLocGenPanel = new ParticleLocGeneratePanel(d_particleList, d_partSizeDist, this);

    // Add the tabs
    partTabbedPane.addTab("Size Distribution", null, particleSizeInputPanel, null);
    partTabbedPane.addTab("Generate Locations", null, particleLocGenPanel, null);
    partTabbedPane.setSelectedIndex(0);

    // Create a grid bag
    GridBagLayout gb = new GridBagLayout();
    GridBagConstraints gbc = new GridBagConstraints();
    setLayout(gb);

    // Set the constraints for the tabbed pane
    UintahGui.setConstraints(gbc, GridBagConstraints.CENTER, 1.0, 1.0, 0, 1, 1, 1, 5);
    gb.setConstraints(partTabbedPane, gbc);
    add(partTabbedPane);

    // Add the change listener
    partTabbedPane.addChangeListener(this);
  }
示例#3
0
  public SettingsFrame() {
    thisFrame = this;
    setTitle(StringConstants.FRAME_SETTINGS);
    setSize(UiConstants.WIN_34_DIM);
    setLocationByPlatform(true);
    setResizable(false);
    setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();

    // add the content panel
    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.setBackground(Color.WHITE);

    tabbedPane.addTab(StringConstants.TAB_GENERAL, new TabGeneral());

    c.fill = GridBagConstraints.BOTH;
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 100;
    c.weighty = 98;
    add(tabbedPane, c);

    c.fill = GridBagConstraints.BOTH;
    c.gridx = 0;
    c.gridy = 1;
    c.gridwidth = 2;
    c.weightx = 100;
    c.weighty = 0;

    // button panel
    add(new OKPanel(), c);
  }
示例#4
0
 public void recordCurrentLayout() {
   if (tabbedPane != null) {
     tp_selectedTab = tabbedPane.getSelectedIndex();
     if (tp_selectedTab >= 0) selectedTabName = tabbedPane.getTitleAt(tp_selectedTab);
     else selectedTabName = null;
   }
 }
示例#5
0
 /**
  * Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR
  * call it in your code!
  *
  * @noinspection ALL
  */
 private void $$$setupUI$$$() {
   myRootPanel = new JPanel();
   myRootPanel.setLayout(new BorderLayout(0, 0));
   final JTabbedPane tabbedPane1 = new JTabbedPane();
   myRootPanel.add(tabbedPane1, BorderLayout.CENTER);
   final JPanel panel1 = new JPanel();
   panel1.setLayout(new BorderLayout(0, 0));
   tabbedPane1.addTab(
       ResourceBundle.getBundle("net/groboclown/idea/p4ic/P4Bundle")
           .getString("user.settings.connection"),
       panel1);
   final JScrollPane scrollPane1 = new JScrollPane();
   panel1.add(scrollPane1, BorderLayout.CENTER);
   myP4ConfigPanel = new P4ConfigPanel();
   scrollPane1.setViewportView(myP4ConfigPanel.$$$getRootComponent$$$());
   final JPanel panel2 = new JPanel();
   panel2.setLayout(new BorderLayout(0, 0));
   tabbedPane1.addTab(
       ResourceBundle.getBundle("net/groboclown/idea/p4ic/P4Bundle")
           .getString("user.settings.prefs"),
       panel2);
   final JScrollPane scrollPane2 = new JScrollPane();
   panel2.add(scrollPane2, BorderLayout.CENTER);
   myUserPreferencesPanel = new UserPreferencesPanel();
   scrollPane2.setViewportView(myUserPreferencesPanel.$$$getRootComponent$$$());
 }
示例#6
0
 private static int getAquaTabbedPaneBaseline(JTabbedPane tp, int height) {
   Font font = tp.getFont();
   FontMetrics metrics = tp.getFontMetrics(font);
   int ascent = metrics.getAscent();
   int offset;
   switch (tp.getTabPlacement()) {
     case JTabbedPane.TOP:
       offset = 5;
       if (tp.getFont().getSize() > 12) {
         offset = 6;
       }
       int yOffset = 20 - metrics.getHeight();
       yOffset /= 2;
       return offset + yOffset + ascent - 1;
     case JTabbedPane.BOTTOM:
       if (tp.getFont().getSize() > 12) {
         offset = 6;
       } else {
         offset = 4;
       }
       return height - (20 - ((20 - metrics.getHeight()) / 2 + ascent)) - offset;
     case JTabbedPane.LEFT:
     case JTabbedPane.RIGHT:
       // Aqua rotates left/right text, so that there isn't a good
       // baseline.
       return -1;
   }
   return -1;
 }
示例#7
0
  OpFooter(OpControl control, List<LayerMode> layerModes) {
    super(BoxLayout.X_AXIS);

    layerControls = new LayerControls(control, layerModes, pcs);
    invertRegionSwitch = new InvertRegionCheckBox(control, pcs);
    colorControls = new ColorSelectionControls(control, pcs);

    Box blendBox = Box.createVerticalBox();
    blendBox.add(Box.createVerticalStrut(5));
    blendBox.add(layerControls);
    blendBox.add(invertRegionSwitch);
    blendBox.setBackground(LightZoneSkin.Colors.ToolPanesBackground);
    layerControls.setAlignmentX(Component.LEFT_ALIGNMENT);
    invertRegionSwitch.setAlignmentX(Component.LEFT_ALIGNMENT);

    tabPane = new JTabbedPane();
    tabPane.setFont(LightZoneSkin.fontSet.getSmallFont());
    tabPane.add(LOCALE.get("ToolSettingsTabName"), blendBox);
    tabPane.add(LOCALE.get("ColorSelectionTabName"), colorControls);

    tabPane.setIconAt(0, getThemeIcon(orangeScheme, true));
    tabPane.setIconAt(1, getThemeIcon(orangeScheme, false));

    add(tabPane, BorderLayout.NORTH);

    setBackground(LightZoneSkin.Colors.ToolPanesBackground);

    pcs.addPropertyChangeListener(this);
  }
  private void resetSemImEditor() {
    java.util.List<SemEstimator> semEstimators = wrapper.getMultipleResultList();

    if (semEstimators.size() == 1) {
      SemEstimator estimatedSem = semEstimators.get(0);
      SemImEditor editor = new SemImEditor(new SemImWrapper(estimatedSem.getEstimatedSem()));
      panel.removeAll();
      panel.add(editor, BorderLayout.CENTER);
      panel.revalidate();
      panel.repaint();

    } else {
      JTabbedPane tabs = new JTabbedPane();

      for (int i = 0; i < semEstimators.size(); i++) {
        SemEstimator estimatedSem = semEstimators.get(i);
        SemImEditor editor = new SemImEditor(new SemImWrapper(estimatedSem.getEstimatedSem()));
        JPanel _panel = new JPanel();
        _panel.setLayout(new BorderLayout());
        _panel.add(editor, BorderLayout.CENTER);
        tabs.addTab(estimatedSem.getDataSet().getName(), _panel);
      }

      panel.removeAll();
      panel.add(tabs);
      panel.validate();
    }
  }
 private void showErrorPanel(ArrayList<String> sqlExecErrorMsgs, String lastExecutedStatement) {
   ErrorPanel errorPanel =
       _resultTabFactory.createErrorPanel(sqlExecErrorMsgs, lastExecutedStatement);
   _tabbedExecutionsPanel.add(
       s_stringMgr.getString("SQLResultExecuterPanel.ErrorTabHeader"), errorPanel);
   _tabbedExecutionsPanel.setSelectedComponent(errorPanel);
 }
 public void setMetricsResults(MetricDisplaySpecification displaySpecification, MetricsRun run) {
   final MetricCategory[] categories = MetricCategory.values();
   for (final MetricCategory category : categories) {
     final JTable table = tables.get(category);
     final String type = MetricsCategoryNameUtil.getShortNameForCategory(category);
     final MetricTableSpecification tableSpecification =
         displaySpecification.getSpecification(category);
     final MetricsResult results = run.getResultsForCategory(category);
     final MetricTableModel model = new MetricTableModel(results, type, tableSpecification);
     table.setModel(model);
     final Container tab = table.getParent().getParent();
     if (model.getRowCount() == 0) {
       tabbedPane.remove(tab);
       continue;
     }
     final String longName = MetricsCategoryNameUtil.getLongNameForCategory(category);
     tabbedPane.add(tab, longName);
     final MyColumnListener columnListener = new MyColumnListener(tableSpecification, table);
     final TableColumnModel columnModel = table.getColumnModel();
     columnModel.addColumnModelListener(columnListener);
     final int columnCount = columnModel.getColumnCount();
     for (int i = 0; i < columnCount; i++) {
       final TableColumn column = columnModel.getColumn(i);
       column.addPropertyChangeListener(columnListener);
     }
     setRenderers(table, type);
     setColumnWidths(table, tableSpecification);
   }
 }
示例#11
0
  private void createHolder() {
    // We display the views in a customised tab pane.
    // This means that if there are multiple views in
    // a particular area they get stacked and are accessible
    // to the user.
    tabbedHolder = new ViewTabbedPane();
    tabbedHolder.setTabPlacement(SwingConstants.BOTTOM);
    // Set the minimum size of the holder so that the
    // split panes can be dragged around easily.  We don't
    // want to set the size to zero, because this allows the
    // contents of the split pane to be completely hidden,
    // which could be confusing for the user.
    // tabbedHolder.setMinimumSize(new Dimension(10, 10));

    tabbedHolder.addContainerListener(
        new ContainerListener() {
          public void componentAdded(ContainerEvent e) {
            if (tabbedHolder.getComponentCount() == 1) {
              ViewHolder.this.add(tabbedHolder);
            }
          }

          public void componentRemoved(ContainerEvent e) {
            if (tabbedHolder.getComponentCount() == 0) {
              ViewHolder.this.remove(tabbedHolder);
            }
          }
        });
  }
  protected void init() {
    setTitle(Messages.getInstance().getString("ChartEditorTitle"));

    editModel = new LegacyChartEditModel();
    editModel.addPropertyChangeListener(
        LegacyChartEditModel.CHART_EXPRESSION_PROPERTY, new ChartExpressionChangeHandler());
    editModel.addPropertyChangeListener(
        LegacyChartEditModel.PRIMARY_DATA_SOURCE_PROPERTY, new PrimaryDataSourceChangeHandler());
    editModel.addPropertyChangeListener(
        LegacyChartEditModel.SECONDARY_DATA_SOURCE_PROPERTY,
        new SecondaryDataSourceChangeHandler());

    chartTable = new ElementMetaDataTable();
    chartPropertiesTableModel = new ChartExpressionPropertiesTableModel();

    primaryDataSourceTable = new ElementMetaDataTable();
    primaryDataSourcePropertiesTableModel = new ExpressionPropertiesTableModel();
    primaryDataSourcePropertiesTableModel.setFilterInlineExpressionProperty(true);

    secondaryDataSourceTable = new ElementMetaDataTable();
    secondaryDataSourcePropertiesTableModel = new ExpressionPropertiesTableModel();
    secondaryDataSourcePropertiesTableModel.setFilterInlineExpressionProperty(true);

    dataSourceTabbedPane = new JTabbedPane();
    dataSourceTabbedPane.add(
        Messages.getInstance().getString("PrimaryDataSource"), createPrimaryDataSourcePanel());
    dataSourceTabbedPane.add(
        Messages.getInstance().getString("SecondaryDataSource"), createSecondaryDataSourcePanel());

    super.init();
  }
示例#13
0
  private void initTabListener() {
    tabbedPane.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent e) {
            if (isVisible()) {
              if (tabbedPane.getTabCount() == 0) {
                // 如是没有了,直接关闭窗口
                dispose();
              } else {
                BasicPanel entityPanel =
                    (BasicPanel) tabbedPane.getComponentAt(tabbedPane.getSelectedIndex());
                entityPanel.installSkin(getSkinService());
                String title = tabbedPane.getTitleAt(tabbedPane.getSelectedIndex());
                setTitle(getI18nService().getMessage("conversationTitle", title));
              }
            }
          }
        });
    tabbedPane.putClientProperty(
        JhromeTabbedPaneUI.TAB_CLOSE_BUTTON_LISTENER,
        new ITabCloseButtonListener() {

          @Override
          public void tabCloseButtonPressed(JTabbedPane tabbedPane, int tabIndex) {
            // 关闭了一个tab,相当于关闭了一个对话
            BasicPanel entityPanel = (BasicPanel) tabbedPane.getComponentAt(tabIndex);

            tabbedPane.removeTabAt(tabIndex);
            ChatManager.removeChat(entityPanel.getEntity());
          }
        });
  }
示例#14
0
 public boolean popdnTool(String name) {
   JComponent obj = searchTool(name);
   if (obj == null) return false;
   if (obj instanceof VToolPanel) {
     if (!((VToolPanel) obj).popdnTool(name)) return false;
   } else {
     if (obj instanceof PushpinIF) {
       PushpinIF pobj = (PushpinIF) obj;
       pobj.pinPopup(false);
     }
     boolean bContain = containTool(obj);
     if (!bContain) return false;
   }
   bChangeTool = true;
   setCurrentLayout();
   if (previous_selectedTab >= 1 && tabbedPane != null) {
     if (tabbedPane.getTabCount() > previous_selectedTab)
       tabbedPane.setSelectedIndex(previous_selectedTab);
   }
   VnmrjIF vif = Util.getVjIF();
   if (vif != null) vif.raiseToolPanel(false);
   if (!pinPanel.isOpen()) pinPanel.setVisible(false);
   bChangeTool = false;
   updateSelectedObj();
   repaint();
   return true;
 }
示例#15
0
  /**
   * Constructor with an existing processUIData.
   *
   * @param processExecutionData Data for the UI
   * @param toolBox ToolBox
   */
  public ProcessUIPanel(ProcessExecutionData processExecutionData, ToolBox toolBox) {
    this.setLayout(new BorderLayout());
    this.processExecutionData = processExecutionData;

    outputJLabelList = new ArrayList<>();
    dataUIManager = toolBox.getDataUIManager();

    buildUI();
    processExecutionData.setProcessUIPanel(this);

    // According to the process state, open the good tab
    switch (processExecutionData.getState()) {
      case IDLE:
        tabbedPane.setSelectedIndex(0);
        break;
      case RUNNING:
        tabbedPane.setSelectedIndex(2);
        break;
      case COMPLETED:
      case ERROR:
        List<String> results = new ArrayList<>();
        for (Map.Entry<URI, Object> entry : processExecutionData.getOutputDataMap().entrySet()) {
          results.add(entry.getValue().toString());
        }
        setOutputs(results, processExecutionData.getState().toString());
        tabbedPane.setSelectedIndex(2);
        break;
    }
    // Print the process execution log.
    for (Map.Entry<String, Color> entry : processExecutionData.getLogMap().entrySet()) {
      print(entry.getKey(), entry.getValue());
    }

    processExecutionData.setState(ProcessExecutionData.ProcessState.IDLE);
  }
示例#16
0
  public TdsMonitor(ucar.util.prefs.PreferencesExt prefs, JFrame parentFrame) throws HTTPException {
    this.mainPrefs = prefs;
    this.parentFrame = parentFrame;

    makeCache();

    fileChooser =
        new FileManager(parentFrame, null, null, (PreferencesExt) prefs.node("FileManager"));

    // the top UI
    tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    managePanel = new ManagePanel((PreferencesExt) mainPrefs.node("ManageLogs"));
    accessLogPanel = new AccessLogPanel((PreferencesExt) mainPrefs.node("LogTable"));
    servletLogPanel = new ServletLogPanel((PreferencesExt) mainPrefs.node("ServletLogPanel"));
    urlDump = new URLDumpPane((PreferencesExt) mainPrefs.node("urlDump"));

    tabbedPane.addTab("ManageLogs", managePanel);
    tabbedPane.addTab("AccessLogs", accessLogPanel);
    tabbedPane.addTab("ServletLogs", servletLogPanel);
    tabbedPane.addTab("UrlDump", urlDump);
    tabbedPane.setSelectedIndex(0);

    setLayout(new BorderLayout());
    add(tabbedPane, BorderLayout.CENTER);

    CredentialsProvider provider = new UrlAuthenticatorDialog(null);
    session = new HTTPSession("TdsMonitor");
    session.setCredentialsProvider(provider);
    session.setUserAgent("TdsMonitor");
  }
  /** Refreshes the currently visible editor with new info. */
  public void refreshEditors(DXEntry entry, DataBrokerQueryInterface ds) {
    if (currentEditor != null) {
      this.entry = entry; // TE: make sure everything is in sink.
      dataSource = ds;

      currentEditor.getDataSink().displayEntry(entry, ds); // checks for unsaved changes...

      // check that the editor hasn't changed display component
      JComponent display = currentEditor.getDisplayComponent();

      // XXX hack alert - some editor writers change their display component
      // XXX mid-flight, and expect JX to magically notice, and change the
      // XXX the display.  This code attempts to do this.

      if (indexOfComponent(display) == -1) // we have a problem - the display component has changed
      {
        String title = currentEditor.getName();
        ImageIcon icon = currentEditor.getIcon();
        String toolTip = currentEditor.getToolTip();

        int index =
            getSelectedIndex(); // find the index of the editor (XXX - this relies on the
                                // activeEditor vector tracking the inherent tab pane order)

        super.remove(index);
        super.insertTab(title, icon, display, toolTip, index);
        super.setSelectedIndex(index);
      }
    } else log.warning("internal error - no editor available in AttributeDisplay");
  }
示例#18
0
  private JPanel pracownikPanel() {
    FormLayout layout3 = new FormLayout("734", "15px, 485px");

    pracownikPanel = new JPanel(layout3);
    // pracownikPanel= new FormDebugPanel(layout3);
    CellConstraints cc = new CellConstraints();
    JLabel labell = new JLabel("Wyloguj");
    labell.addMouseListener(
        new MouseAdapter() {
          public void mousePressed(MouseEvent me) {
            CardLayout c1 = (CardLayout) (utworzPanel.getLayout());
            c1.show(utworzPanel, "card1");
            tx1.setText("");
            tx2.setText("");
          }
        });

    Color c = new Color(153, 180, 209);
    pracownikPanel.setBackground(c);
    tabbedPane2 = new JTabbedPane(JTabbedPane.LEFT);
    tabbedPane2.setBorder(null);
    tabbedPane2.addTab("Raport", new ImageIcon("images/spotkania.png"), new Raport());
    Font font = new Font("Arial", Font.BOLD, 15);
    tabbedPane2.setFont(font);

    tabbedPane2.setBackground(c);

    pracownikPanel.add(tabbedPane2, cc.xy(1, 2));
    pracownikPanel.add(labell, cc.xy(1, 1, CellConstraints.RIGHT, CellConstraints.TOP));
    return pracownikPanel;
  }
  private void updateTabBar(Vector vtThread) {
    pnlThread.removeAll();
    for (int iThreadIndex = 0; iThreadIndex < vtThread.size(); iThreadIndex++) {
      try {
        Vector vtThreadInfo = (Vector) vtThread.elementAt(iThreadIndex);
        PanelThreadMonitor mntTemp = new PanelThreadMonitor(channel);

        String strThreadID = (String) vtThreadInfo.elementAt(0);
        String strThreadName = (String) vtThreadInfo.elementAt(1);
        int iThreadStatus = Integer.parseInt((String) vtThreadInfo.elementAt(2));
        mntTemp.setThreadID(strThreadID);
        mntTemp.setThreadName(strThreadName);
        mntTemp.setThreadStatus(iThreadStatus);
        showResult(mntTemp.txtMonitor, (String) vtThreadInfo.elementAt(3));
        mntTemp.addPropertyChangeListener(this);

        pnlThread.add(strThreadName, mntTemp);
        mntTemp.updateStatus();
      } catch (Exception e) {
        e.printStackTrace();
        MessageBox.showMessageDialog(this, e, Global.APP_NAME, MessageBox.ERROR_MESSAGE);
      }
    }
    Skin.applySkin(this);
  }
  private void assertTabCount(Content content) {
    //        PluginSettingsBean bean = (PluginSettingsBean)
    // SharedObjectPool.getUserData(SharedConstants.PLUGIN_SETTINGS);
    PluginSettingsBean bean = PluginKeys.PLUGIN_SETTINGS.getData();

    if (bean == null) {
      bean = new PluginSettingsBean();
    }

    int max = bean.getNumberOfTabs();

    if (max <= getTabComponent(content).getTabCount()) {
      // remove the oldest tab
      JTabbedPane tabbedPane = getTabComponent(content);
      long lastMin = Long.MAX_VALUE;
      int index = 0;
      for (int i = 0; i < tabbedPane.getTabCount(); i++) {
        JComponent tab = (JComponent) tabbedPane.getTabComponentAt(i);
        Long time = (Long) tab.getClientProperty(CREATE_TIME);
        if (time != null && lastMin < time) {
          lastMin = time;
          index = i;
        }
      }

      tabbedPane.remove(index);
    }
  }
  public MidiConfigurationCanvas(
      BlipBoxApplication application, MidiOutputEventHandler eventhandler, BlipBox sender) {
    this.eventhandler = eventhandler;
    this.sender = sender;

    JTabbedPane tabs = new JTabbedPane();

    JPanel control = new BlipBoxControlPanel(application);
    tabs.addTab("Setup", control);

    ModeConfigurationPanel panel = new ModeConfigurationPanel("Cross");
    modes.put(panel.getOperationMode(), panel);
    tabs.addTab("Cross Mode", panel);
    panel = new ModeConfigurationPanel("Criss");
    modes.put(panel.getOperationMode(), panel);
    tabs.addTab("Criss Mode", panel);

    add(tabs);

    setup("Cross", true, false, false);
    setup("Cross", SensorType.X_SENSOR, "Unassigned");
    setup("Cross", SensorType.Y_SENSOR, "Control Change", 1, Y_NOTES_CC, 0, 127);
    setup("Cross", SensorType.POT_SENSOR, "Control Change", 1, POT_CC, 0, 127);
    setup("Cross", SensorType.BUTTON1_SENSOR, "Mode Change", "Criss");

    setup("Criss", false, false, false);
    setup("Criss", SensorType.X_SENSOR, "Control Change", 1, X_CC, 0, 127);
    setup("Criss", SensorType.Y_SENSOR, "Control Change", 1, Y_CC, 0, 127);
    setup("Criss", SensorType.POT_SENSOR, "Control Change", 1, POT_CC, 0, 127);
    setup("Criss", SensorType.BUTTON1_SENSOR, "Mode Change", "Cross");
  }
 protected void showFirstPage() {
   if (tabbedPanel.getTabCount() <= 0) cardLayout.show(finalPanel, "FirstPanel");
   else {
     cardLayout.show(finalPanel, "TabbedPanel");
     tabbedPanel.setSelectedIndex(0);
   }
 }
示例#23
0
 public void evaluate() {
   try {
     // clear problems and console messages
     problemsView.setText("");
     consoleView.setText("");
     // update status view
     statusView.setText(" Parsing ...");
     tabbedPane.setSelectedIndex(0);
     LispExpr root = Parser.parse(textView.getText());
     statusView.setText(" Running ...");
     tabbedPane.setSelectedIndex(1);
     // update run button
     runButton.setIcon(stopImage);
     runButton.setActionCommand("Stop");
     // start run thread
     runThread = new RunThread(root);
     runThread.start();
   } catch (SyntaxError e) {
     tabbedPane.setSelectedIndex(0);
     System.err.println(
         "Syntax Error at " + e.getLine() + ", " + e.getColumn() + " : " + e.getMessage());
   } catch (Error e) {
     // parsing error
     System.err.println(e.getMessage());
     statusView.setText(" Errors.");
   }
 }
示例#24
0
  private void layoutBottomRightPart(JSplitPane rightSplitPanel) {
    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    rightSplitPanel.setBottomComponent(tabbedPane);

    tabbedPane.addTab("Images", null, mImageListPanel, null);
  }
  /** TabbedPaneDemo Constructor */
  public TabbedPaneDemo(SwingSet2 swingset) {
    // Set the title for this demo, and an icon used to represent this
    // demo inside the SwingSet2 app.
    super(swingset, "TabbedPaneDemo", "toolbar/JTabbedPane.gif");

    // create tab position controls
    JPanel tabControls = new JPanel();
    tabControls.add(new JLabel(getString("TabbedPaneDemo.label")));
    top = (JRadioButton) tabControls.add(new JRadioButton(getString("TabbedPaneDemo.top")));
    left = (JRadioButton) tabControls.add(new JRadioButton(getString("TabbedPaneDemo.left")));
    bottom = (JRadioButton) tabControls.add(new JRadioButton(getString("TabbedPaneDemo.bottom")));
    right = (JRadioButton) tabControls.add(new JRadioButton(getString("TabbedPaneDemo.right")));
    getDemoPanel().add(tabControls, BorderLayout.NORTH);

    group = new ButtonGroup();
    group.add(top);
    group.add(bottom);
    group.add(left);
    group.add(right);

    top.setSelected(true);

    top.addActionListener(this);
    bottom.addActionListener(this);
    left.addActionListener(this);
    right.addActionListener(this);

    // create tab
    tabbedpane = new JTabbedPane();
    getDemoPanel().add(tabbedpane, BorderLayout.CENTER);

    String name = getString("TabbedPaneDemo.laine");
    JLabel pix = new JLabel(createImageIcon("tabbedpane/laine.jpg", name));
    tabbedpane.add(name, pix);

    name = getString("TabbedPaneDemo.ewan");
    pix = new JLabel(createImageIcon("tabbedpane/ewan.jpg", name));
    tabbedpane.add(name, pix);

    name = getString("TabbedPaneDemo.hania");
    pix = new JLabel(createImageIcon("tabbedpane/hania.jpg", name));
    tabbedpane.add(name, pix);

    name = getString("TabbedPaneDemo.bounce");
    spin = new HeadSpin();
    tabbedpane.add(name, spin);

    tabbedpane
        .getModel()
        .addChangeListener(
            new ChangeListener() {
              public void stateChanged(ChangeEvent e) {
                SingleSelectionModel model = (SingleSelectionModel) e.getSource();
                if (model.getSelectedIndex() == tabbedpane.getTabCount() - 1) {
                  spin.go();
                }
              }
            });
  }
 int indexOf(String strThreadID) {
   int iMonitorCount = pnlThread.getComponentCount();
   for (int iMonitorIndex = 0; iMonitorIndex < iMonitorCount; iMonitorIndex++) {
     PanelThreadMonitor mntTemp = ((PanelThreadMonitor) pnlThread.getComponentAt(iMonitorIndex));
     if (mntTemp.mstrThreadID.equals(strThreadID)) return iMonitorIndex;
   }
   return -1;
 }
示例#27
0
 protected Component getTab(String name) {
   for (int i = 0; i < tabPane.getTabCount(); i++) {
     if (tabPane.getTitleAt(i).equals(name)) {
       return tabPane.getComponentAt(i);
     }
   }
   return null;
 }
示例#28
0
 /** Build the UI of the ProcessFrame with the data of the processUIData. */
 private void buildUI() {
   // Adds to the tabbedPane the 3 panels
   tabbedPane = new JTabbedPane();
   tabbedPane.addTab("Configuration", buildUIConf(processExecutionData));
   tabbedPane.addTab("Information", buildUIInfo(processExecutionData));
   tabbedPane.addTab("Execution", buildUIExec(processExecutionData));
   this.add(tabbedPane, BorderLayout.CENTER);
 }
 public void testTabbedPane() throws Exception {
   JTabbedPane tabbedPane =
       (JTabbedPane) getInstrumentedRootComponent("TestTabbedPane.form", "BindingTest");
   assertEquals(2, tabbedPane.getTabCount());
   assertEquals("First", tabbedPane.getTitleAt(0));
   assertEquals("Test Value", tabbedPane.getTitleAt(1));
   assertTrue(tabbedPane.getComponentAt(0) instanceof JLabel);
   assertTrue(tabbedPane.getComponentAt(1) instanceof JButton);
 }
示例#30
0
  public void addPanel(String name, JPanel panel) {

    if (tabbedPane.getTabCount() == 0) {
      preffered = panel.getPreferredSize();
    }

    panel.setPreferredSize(preffered);
    tabbedPane.add(name, panel);
  }