コード例 #1
0
  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();
  }
コード例 #2
0
 /**
  * Constructs the tab for monitors and uploads.
  *
  * @param MONITOR_VIEW the <tt>MonitorView</tt> instance containing all component for the monitor
  *     display and handling
  * @param UPLOAD_MEDIATOR the <tt>UploadMediator</tt> instance containing all component for the
  *     monitor display and handling
  */
 public MonitorUploadTab(final MonitorView MONITOR_VIEW, final ComponentMediator UPLOAD_MEDIATOR) {
   super(I18n.tr("Monitor"), I18n.tr("View Searches and Uploads"), "monitor_tab");
   SPLIT_PANE =
       new JSplitPane(JSplitPane.VERTICAL_SPLIT, MONITOR_VIEW, UPLOAD_MEDIATOR.getComponent());
   SPLIT_PANE.setContinuousLayout(true);
   SPLIT_PANE.setOneTouchExpandable(true);
   DividerLocationSettingUpdater.install(
       SPLIT_PANE, UISettings.UI_MONITOR_UPLOAD_TAB_DIVIDER_LOCATION);
 }