Example #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);
  }
  public void setEnabled(boolean status) {
    if (status == isEnabled()) {
      return;
    }

    if (status) {
      // Enable the frame
      super.setEnabled(status);
      // Enable its children according to their __GO_UI_ENABLE__ property
      Integer[] children =
          (Integer[]) GraphicController.getController().getProperty(getId(), __GO_CHILDREN__);
      for (int kChild = 0; kChild < children.length; kChild++) {
        Boolean childStatus =
            (Boolean)
                GraphicController.getController().getProperty(children[kChild], __GO_UI_ENABLE__);
        SwingView.getFromId(children[kChild]).update(__GO_UI_ENABLE__, childStatus);
      }
    } else {
      // Disable the frame
      super.setEnabled(status);
      // Disable its children
      Component[] components = getComponents();
      for (int compIndex = 0; compIndex < components.length; compIndex++) {
        components[compIndex].setEnabled(false);
      }
    }
  }
Example #3
0
  public void draw() {
    JFrame frame = new JFrame("Depth Chart");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JTabbedPane tabs = new JTabbedPane();

    JPanel offense = new JPanel();
    String[] qbs = {"12 Brady", "10 Garoppolo", "8 Flynn"};
    JComboBox qb = new JComboBox(qbs);
    qb.add(new JLabel("Quarterbacks"));
    offense.add(qb);
    tabs.add("Offense", offense);

    JPanel defense = new JPanel();
    String[] des = {"95 Jones", "50 Ninkovich", "93 Sheard"};
    JComboBox de = new JComboBox(des);
    de.add(new JLabel("Defensive ends"));
    defense.add(de);
    tabs.add("Defense", defense);

    JPanel st = new JPanel();
    String[] ks = {"3 Gostkowski"};
    JComboBox k = new JComboBox(ks);
    k.add(new JLabel("Kickers"));
    st.add(k);
    tabs.add("Special teams", st);

    frame.add(tabs);
    frame.pack();
    frame.setVisible(true);
  }
Example #4
0
 /** {@inheritDoc} */
 @Override
 protected JComponent buildFormPanel() {
   tabPanel = new JTabbedPane();
   tabPanel.addTab("General", buildGeneralForm());
   tabPanel.addTab("Comentarios", buildObservacionesPanel());
   return tabPanel;
 }
Example #5
0
 private JPanel addResultPane() {
   JPanel resultPane = new JPanel(new BorderLayout());
   resultPane.setOpaque(false);
   int componentCount = southPanel.getComponentCount();
   if (componentCount == 0) {
     southPanel.add(resultPane, BorderLayout.CENTER);
     southPanel.revalidate();
     southPanel.repaint();
   } else {
     JTabbedPane tabbedPane;
     Component component0 = southPanel.getComponent(0);
     if (component0 instanceof JTabbedPane) {
       tabbedPane = (JTabbedPane) component0;
     } else {
       JPanel query1Panel = (JPanel) component0;
       southPanel.remove(0);
       tabbedPane = new JTabbedPane();
       tabbedPane.addTab("Query 1", query1Panel);
       southPanel.add(tabbedPane, BorderLayout.CENTER);
       southPanel.revalidate();
       southPanel.repaint();
     }
     tabbedPane.addTab("Query " + (tabbedPane.getTabCount() + 1), resultPane);
   }
   return resultPane;
 }
Example #6
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());
          }
        });
  }
Example #7
0
 private JTabbedPane createTabPane() {
   final JTabbedPane tabPane = new JTabbedPane();
   final PlaterPanel platerTab = new PlaterPanel(configuration, plater, actions);
   tabPane.addTab("Plater", null, platerTab, "Place things on the build platform.");
   final SettingsEditor settingsEditor = new SettingsEditor(configuration);
   tabPane.addTab("Settings Editor", null, settingsEditor, "Edit the configuration.");
   tabPane.addTab(
       "Visual Slicer",
       null,
       simulationTab,
       "Shows the current slice. "
           + "<space> to pause, "
           + "<b> to show boxes around polygons, "
           + "left click to magnify, "
           + "right click to restore default magnification.");
   tabPane.addChangeListener(
       new ChangeListener() {
         @Override
         public void stateChanged(final ChangeEvent e) {
           if (platerTab == tabPane.getSelectedComponent()) {
             platerTab.updateDisplay();
           }
           simulationTab.hookListeners(simulationTab == tabPane.getSelectedComponent());
           settingsEditor.hookListener(settingsEditor == tabPane.getSelectedComponent());
         }
       });
   return tabPane;
 }
Example #8
0
  // Create a new document
  public void clear() {
    areaEditPanel.clear();
    puzzleEditPanel.clear();

    areaGraph = new mxGraph();
    areaGraph.setAutoSizeCells(true);
    areaGraphComponent.setGraph(areaGraph);
    areaGraphLayout =
        new mxOrganicLayout(
            areaGraph,
            new Rectangle(0, 0, graphPanel.getBounds().width, graphPanel.getBounds().height));
    areaGraph.setEnabled(false);

    puzzleGraph = new mxGraph();
    puzzleGraph.setAutoSizeCells(true);
    puzzleGraphComponent.setGraph(puzzleGraph);
    puzzleGraphOrganicLayout =
        new mxOrganicLayout(
            puzzleGraph,
            new Rectangle(0, 0, graphPanel.getBounds().width, graphPanel.getBounds().height));
    puzzleGraphHierLayout = new mxHierarchicalLayout(puzzleGraph, SwingConstants.WEST);
    hierarchyRoot = null;

    AreaEditPanel.reset();
    CombinePuzzleBlock.reset();
    InsertionPuzzleBlock.reset();
    DoorUnlockBlock.reset();
    FilterBlock.reset();
    InsertionPuzzleBlock.reset();
    ItemRequestPuzzleBlock.reset();
    PropertyChangePuzzleBlock.reset();
    SpawnPuzzleBlock.reset();
    OutputBlock.reset();
    ORBlock.reset();
  }
  public void setLabels() {

    // TODO --- finish set labels

    // tab titles
    tabbedPane.setTitleAt(0, app.getMenu("Properties.Basic"));
    tabbedPane.setTitleAt(1, app.getPlain("xAxis"));
    tabbedPane.setTitleAt(2, app.getPlain("yAxis"));
    tabbedPane.setTitleAt(3, app.getMenu("Grid"));

    // window dimension panel
    dimLabel[0].setText("X " + app.getPlain("min") + ":");
    dimLabel[1].setText("X " + app.getPlain("max") + ":");
    dimLabel[2].setText("Y " + app.getPlain("min") + ":");
    dimLabel[3].setText("Y " + app.getPlain("max") + ":");
    axesRatioLabel.setText(app.getPlain("xAxis") + " : " + app.getPlain("yAxis") + " = ");
    //	dimPanelTitle = "ttt";

    cbView.removeActionListener(this);
    cbView.removeAllItems();
    cbView.addItem(app.getPlain("DrawingPad"));
    cbView.addItem(app.getPlain("DrawingPad2"));
    cbView.removeActionListener(this);

    cbShowMouseCoords.setText(app.getMenu("ShowMouseCoordinates"));
  }
Example #10
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");
  }
Example #11
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);
  }
  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;
  }
  protected void abrirTelaCliente() {
    TelaCadastroCliente telacadastrocliente = new TelaCadastroCliente();

    telacadastrocliente.setCloseAction(e -> tabbedPane.remove(telacadastrocliente));
    tabbedPane.addTab("Cliente", telacadastrocliente);
    mostraUltima();
  }
Example #14
0
 public void addView(View view) {
   container.addTab("", null, view.getContent());
   JPanel panel = new JPanel();
   panel.add(new JLabel("My Title"));
   panel.add(createXButton());
   container.setTabComponentAt(container.getTabCount() - 1, panel);
 }
 public TvShowSettingsContainerPanel() {
   setLayout(new BorderLayout(0, 0));
   {
     JTabbedPane tabbedPanePages = new JTabbedPane(JTabbedPane.TOP);
     add(tabbedPanePages, BorderLayout.CENTER);
     {
       JScrollPane scrollPane = new JScrollPane();
       scrollPane.setViewportView(new TvShowSettingsPanel());
       tabbedPanePages.addTab(
           BUNDLE.getString("Settings.general"), null, scrollPane, null); // $NON-NLS-1$
     }
     {
       JScrollPane scrollPane = new JScrollPane();
       scrollPane.setViewportView(new TvShowScraperSettingsPanel());
       tabbedPanePages.addTab(
           BUNDLE.getString("Settings.scraper"), null, scrollPane, null); // $NON-NLS-1$
     }
     {
       JScrollPane scrollPane = new JScrollPane();
       scrollPane.setViewportView(new TvShowRenamerSettingsPanel());
       tabbedPanePages.addTab(
           BUNDLE.getString("Settings.renamer"), null, scrollPane, null); // $NON-NLS-1$
     }
   }
 }
Example #16
0
  /** Handle OK/Cancel selections */
  @Override
  public void close(String actionCommand) {
    super.close(actionCommand);

    if (isOKorAccept(actionCommand)) {
      World world = clientFrame.getWorld();

      // this isn't really the way to do it
      GamePanel gp = (GamePanel) tabPane.getComponentAt(0);
      GameMetadata gmd = new GameMetadata();
      gp.write(gmd);
      world.setGameMetadata(gmd);

      // assume panels 1-n are all player panels
      for (int i = 1; i < tabPane.getTabCount(); i++) {
        PlayerPanel pp = (PlayerPanel) tabPane.getComponentAt(i);
        PlayerMetadata pmd = new PlayerMetadata();
        pp.write(pmd);
        world.setPlayerMetadata(pp.getPower(), pmd);
      }

      // set data-changed flag
      clientFrame.fireStateModified();
    }

    if (propertyListener != null) {
      clientFrame.removePropertyChangeListener(propertyListener);
    }
  } // close()
Example #17
0
  /** builds the UI */
  protected final void build() {
    tabbedPane = new JTabbedPane();

    propertiesMerger = new PropertiesMerger();
    propertiesMerger.setName("panel.propertiesmerger");
    propertiesMerger.getModel().addPropertyChangeListener(this);
    tabbedPane.add(tr("Properties"), propertiesMerger);

    tagMerger = new TagMerger();
    tagMerger.setName("panel.tagmerger");
    tagMerger.getModel().addPropertyChangeListener(this);
    tabbedPane.add(tr("Tags"), tagMerger);

    nodeListMerger = new NodeListMerger();
    nodeListMerger.setName("panel.nodelistmerger");
    nodeListMerger.getModel().addPropertyChangeListener(this);
    tabbedPane.add(tr("Nodes"), nodeListMerger);

    relationMemberMerger = new RelationMemberMerger();
    relationMemberMerger.setName("panel.relationmembermerger");
    relationMemberMerger.getModel().addPropertyChangeListener(this);
    tabbedPane.add(tr("Members"), relationMemberMerger);

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

    conflictResolvers.add(propertiesMerger);
    conflictResolvers.add(tagMerger);
    conflictResolvers.add(nodeListMerger);
    conflictResolvers.add(relationMemberMerger);
  }
Example #18
0
 public void recordCurrentLayout() {
   if (tabbedPane != null) {
     tp_selectedTab = tabbedPane.getSelectedIndex();
     if (tp_selectedTab >= 0) selectedTabName = tabbedPane.getTitleAt(tp_selectedTab);
     else selectedTabName = null;
   }
 }
  public SplitPane(
      Frame aFrame,
      ProgressBarPanel aProgressBar,
      MessageTable aMessageTable,
      MessageTree aMessageTree,
      JTabbedPane aUpperTabbedPane,
      JTabbedPane aLowerTabbedPane,
      DefaultDataDictionaryAccess aDataDictionary) {
    super(JSplitPane.VERTICAL_SPLIT, aUpperTabbedPane, aLowerTabbedPane);

    frame = aFrame;
    menuBar = (MenuBar) aFrame.getJMenuBar();
    progressBar = aProgressBar;
    messageTable = aMessageTable;
    messageTree = aMessageTree;
    messageTree.setModel(null);
    upperTabbedPane = aUpperTabbedPane;
    dataDictionary = aDataDictionary;

    aLowerTabbedPane.add("Grid", new JScrollPane(messageTable));
    aLowerTabbedPane.add("Tree", new JScrollPane(messageTree));
    aUpperTabbedPane.addChangeListener(this);
    messageTable.addMouseListener(this);
    messageTree.addMouseListener(this);

    tracer =
        new Timer(
            5000,
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                traceFile();
              }
            });
  }
    private JTabbedPane createTab() {
      Font mainFont = new Font("Times New Roman", Font.BOLD, 11);
      tabbedPane.setFont(mainFont);
      tabbedPane.setBorder(new BevelBorder(BevelBorder.LOWERED));

      tabbedPane.add("New application", new NewAppPanel());

      JPanel existingApp = new JPanel();
      existingApp.setLayout(new BoxLayout(existingApp, BoxLayout.X_AXIS));
      JLabel pictureLabel = new JLabel("Configuration:");
      JButton pictureChooser = new JButton("Choose");

      pictureFileName.setEditable(false);
      pictureFileName.setMaximumSize(new Dimension(contentPane.getPreferredSize().width, 25));
      existingApp.add(Box.createHorizontalStrut(20));
      existingApp.add(pictureLabel);
      existingApp.add(pictureFileName);
      existingApp.add(Box.createHorizontalStrut(5));
      existingApp.add(pictureChooser);
      existingApp.add(Box.createHorizontalStrut(20));
      pictureChooser.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              loadFromFile();
            }
          });
      tabbedPane.add("Existing application", existingApp);
      tabbedPane.setPreferredSize(contentPane.getPreferredSize());

      return tabbedPane;
    }
Example #21
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;
 }
Example #22
0
 /**
  * Must be called to connect to an archive.
  *
  * @param archive the archive to mount.
  */
 protected void doMount(Archive archive) {
   this.archive = archive;
   archive.getRoot().mkdirs();
   logger = new DownloadLogger(archive);
   logger.clear();
   setTitle("Raccoon - " + archive.getRoot().getAbsolutePath());
   views.removeAll();
   if (archive.getAndroidId().length() == 0) {
     views.addTab("Archive setup", InitView.create(this, archive));
   } else {
     searchView = SearchView.create(this, archive);
     updates.setEnabled(true);
     views.addTab("Search", searchView);
     views.addChangeListener(searchView);
     search.setEnabled(true);
     downloads.setEnabled(true);
     downloadListScroll = new JScrollPane();
     downloadListScroll.setViewportView(downloadList);
     downloadListScroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
     views.addTab("Downloads", downloadListScroll);
     Preferences prefs = Preferences.userNodeForPackage(getClass());
     prefs.put(LASTARCHIVE, archive.getRoot().getAbsolutePath());
     SwingUtilities.invokeLater(searchView);
   }
 }
Example #23
0
  /**
   * Removes the specified <code>JSChannelsPane</code> from the view.
   *
   * @param chnPane The <code>JSChannelsPane</code> to be removed.
   * @return <code>true</code> if the specified code>JSChannelsPane</code> is actually removed from
   *     the view, <code>false</code> otherwise.
   */
  public boolean removeChannelsPane(JSChannelsPane chnPane) {
    chnPane.removeListSelectionListener(this);

    tabbedPane.remove(chnPane);
    boolean b = super.removeChannelsPane(chnPane);
    for (int i = 0; i < miList.size(); i++) {
      A4n.MoveChannelsTo a = (A4n.MoveChannelsTo) miList.get(i).getAction();
      if (a.getChannelsPane().equals(chnPane)) {
        miList.remove(i);
        break;
      }
    }

    updateTabsMenu();

    if (getChannelsPaneCount() == 1) {
      A4n.closeChannelsTab.setEnabled(false);
      A4n.editTabTitle.setEnabled(false);
      tabbedPane.remove(getChannelsPane(0));
      channelsPane.remove(tabbedPane);
      channelsPane.add(getChannelsPane(0));
    }

    return b;
  }
Example #24
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.");
   }
 }
Example #25
0
 public void actionPerformed(ActionEvent event) {
   Object src = event.getSource();
   if (src == quit) {
     doQuit();
   }
   if (src == close) {
     doClose();
   }
   if (src == open) {
     doOpen();
   }
   if (src == downloads) {
     views.setSelectedIndex(1);
   }
   if (src == search) {
     views.setSelectedIndex(0);
   }
   if (src == contents) {
     BrowseUtil.openUrl("http://www.onyxbits.de/raccoon/handbook");
   }
   if (src == updates) {
     views.setSelectedIndex(0);
     searchView.doUpdateSearch();
   }
 }
  public DataModel getDataModel(TypeEl typeEl) {
    String type = new String();
    switch (typeEl) {
      case CD:
        type = "CD";
        break;
      case DVD:
        type = "DVD";
        break;
      case LIVRE:
        type = "Livre";
        break;
      case JEUX:
        type = "Jeux";
        break;
      case BD:
        type = "BD";
        break;
    }
    tabbedpane.setSelectedIndex(tabbedpane.indexOfTab(type));

    JScrollPane t = (JScrollPane) tabbedpane.getComponent(tabbedpane.indexOfTab(type));
    JViewport view = t.getViewport();
    JTable f = (JTable) view.getView();
    DataModel model = (DataModel) f.getModel();

    return model;
  }
Example #27
0
  protected void updateTabes(KeyEvent arg0) {
    Tab tabee = tabAccess.get(tab.getSelectedIndex());
    if (arg0.getKeyCode() == KeyEvent.VK_ENTER) {
      MyEditorPane pane = new MyEditorPane(addressBar.getText());
      pane.addHyperlinkListener(HYHandler);
      JScrollPane scPane = new JScrollPane(pane);
      tabee.addPane(pane);
      pane.setEditable(false);

      int i = tab.getSelectedIndex();

      tabcreate = false;
      tab.remove(i);
      tabcreate = false;
      change = false;
      tab.insertTab(tabee.getPane().getAddress(), null, scPane, null, i);
      tabcreate = false;
      addCloseButton(i, tabee.getPane().getAddress());
      change = false;
      tabcreate = false;
      tab.setSelectedIndex(i);
      change = false;
      tabcreate = false;

      loadPage(pane, tabee.getPane().getAddress());
      tabcreate = true;
      return;
    }
    tabee.setAddress(addressBar.getText());
  }
Example #28
0
  protected void back() {

    Tab tabee = tabAccess.get(tab.getSelectedIndex());
    MyEditorPane p = tabee.getBeforPane();

    JScrollPane scPane = new JScrollPane(p);
    int i = tab.getSelectedIndex();
    tabcreate = false;
    change = false;
    tab.remove(i);
    change = false;
    tabcreate = false;
    tab.insertTab(tabee.getPane().getAddress(), null, scPane, null, i);
    addressBar.setText(tabee.getPane().getAddress());
    tabcreate = false;
    change = false;
    addCloseButton(i, tabee.getPane().getAddress());
    change = false;
    tabcreate = false;
    change = false;
    tab.setSelectedIndex(i);
    tabcreate = false;
    change = false;
    tabcreate = true;
  }
Example #29
0
 /**
  * remove tab
  *
  * @param i
  */
 protected void removeTab(int i) {
   if (i == 0) System.exit(1);
   tab.remove(i - 1);
   tabcreate = false;
   tab.setSelectedIndex(tab.getTabCount() - 2);
   tabAccess.remove(i - 1);
 }
  public OpenDecisionsPanel() {
    odList_ = new Vector<List<String>>();
    snList_ = new Vector<Integer>();
    ledList_ = new Vector<String>();

    currentIdx_ = -1;

    labelTotal_ = new JLabel(makeLabelTotal(), SwingConstants.CENTER);
    labelCurrent_ = new JLabel(makeLabelCurrent(), SwingConstants.CENTER);
    JPanel btnPanel = new JPanel(new FlowLayout());

    btnPrev_ = new JButton("<<");
    btnPrev_.addActionListener(this);
    btnPrev_.setActionCommand("prev");
    btnNext_ = new JButton(">>");
    btnNext_.addActionListener(this);
    btnNext_.setActionCommand("next");
    checkButtons();
    JButton btn;
    btn = new JButton("Go To Step");
    btn.addActionListener(this);
    btn.setActionCommand("goto");

    gotoIdx_ = new JTextField(6);
    btnPanel.add(btnPrev_);
    btnPanel.add(btnNext_);
    btnPanel.add(btn);
    btnPanel.add(gotoIdx_);

    lastExecutedDecision_ = new JTextArea(5, 10);
    lastExecutedDecision_.setLineWrap(true);

    JPanel topPanel = new JPanel(new BorderLayout());
    JPanel p = new JPanel(new GridLayout(3, 1));
    p.add(labelTotal_);
    p.add(btnPanel);
    p.add(new JLabel("Last Executed Decision", SwingConstants.CENTER));

    ledTable_ = new JTable();
    ledTable_.setTableHeader(null);
    ledTable_.setPreferredScrollableViewportSize(new Dimension(500, 70));

    JTabbedPane tp = new JTabbedPane();
    tp.addTab("As Table", new JScrollPane(ledTable_));
    tp.addTab("As Text", new JScrollPane(lastExecutedDecision_));

    topPanel.add(BorderLayout.NORTH, p);
    topPanel.add(BorderLayout.CENTER, tp);
    odTable_ = new JTable(Util.makeTableModel(odList_, new String[] {"toString"}));
    odTable_.setTableHeader(null);
    odTable_.setPreferredScrollableViewportSize(new Dimension(500, 70));

    setLayout(new BorderLayout());
    add(BorderLayout.NORTH, topPanel);

    JPanel odPanel = new JPanel(new BorderLayout());
    odPanel.add(BorderLayout.NORTH, labelCurrent_);
    odPanel.add(BorderLayout.CENTER, new JScrollPane(odTable_));
    add(BorderLayout.CENTER, odPanel);
  }