private void init() {
    agents = new JComboBox(model);
    agents.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            stateChanged(event);
          }
        });
    agents.addActionListener(TextChangesListener.getInstance());
    ctm = new CreationTableModel();
    datatable = new JTable(ctm);
    datatable.setShowGrid(false);
    datatable.setEnabled(false);
    datatable.setTableHeader(null);
    datatable.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3));
    JPanel apanel = new JPanel(new BorderLayout());
    apanel.add(new JLabel("Who took the photo: "), BorderLayout.WEST);
    apanel.add(agents, BorderLayout.CENTER);
    JPanel tablePanel = new JPanel(new BorderLayout());
    tablePanel.add(new JScrollPane(datatable), BorderLayout.CENTER);

    datatable.getColumnModel().getColumn(0).setMaxWidth(120);
    datatable.getColumnModel().getColumn(0).setMinWidth(80);

    datatable.addKeyListener(TextChangesListener.getInstance());

    this.add(
        ComponentFactory.createTitledPanel("Creator of the image:", apanel), BorderLayout.NORTH);
    this.add(
        ComponentFactory.createTitledPanel("Creation, EXIF & technical information:", tablePanel),
        BorderLayout.CENTER);
    this.add(new JSeparator(JSeparator.HORIZONTAL), BorderLayout.WEST);
  }
  public static void main(String[] args) {
    ComponentFactory factory = WindowsComponentFactory.getInstance();

    CustomButton button1 = factory.createButton();
    CustomLabel label1 = factory.createLabel();

    System.out.println("Button1: " + button1.getText());
    System.out.println("Label1: " + label1.getText());

    /*
     * Output:
     * Button1: WindowsButton - Click me
     * Label1: WindowsLabel - Read me
     */

    factory = LinuxComponentFactory.getInstance();

    CustomButton button2 = factory.createButton();
    CustomLabel label2 = factory.createLabel();

    System.out.println("Button2: " + button2.getText());
    System.out.println("Label2: " + label2.getText());

    /*
     * Output:
     * Button2: LinuxButton - Click me
     * Label2: LinuxLabel - Read me
     */
  }
  /** ****************************************************************************** */
  private JPanel createButtonPanel() {
    ActionListener selectActionListener = new SelectButtonActionListener();
    ActionListener cancelActionListener = new CancelButtonActionListener();
    JPanel buttonPanel = ComponentFactory.createButtonPanel();
    JButton selectButton = ComponentFactory.createSaveButton(selectActionListener);
    JButton cancelButton = ComponentFactory.createCancelButton(cancelActionListener);
    selectButton.setText("Select");
    buttonPanel.add(selectButton);
    buttonPanel.add(cancelButton);

    return buttonPanel;
  }
 /** {@inheritDoc} */
 @Override
 public void addMenuItemsWithExpansion(
     List<JMenuItem> menuItems,
     JMenu parentMenu,
     int maxItemsInMenu,
     ComponentFactory headerItemFactory) {
   if (menuItems.size() <= maxItemsInMenu) {
     // Just add them directly
     for (JMenuItem menuItem : menuItems) parentMenu.add(menuItem);
     return;
   }
   int index = 0;
   while (index < menuItems.size()) {
     int toIndex = min(menuItems.size(), index + maxItemsInMenu);
     if (toIndex == menuItems.size() - 1)
       // Don't leave a single item left for the last subMenu
       toIndex--;
     List<JMenuItem> subList = menuItems.subList(index, toIndex);
     JMenuItem firstItem = subList.get(0);
     JMenuItem lastItem = subList.get(subList.size() - 1);
     JMenu subMenu = new JMenu(firstItem.getText() + " ... " + lastItem.getText());
     if (headerItemFactory != null) subMenu.add(headerItemFactory.makeComponent());
     for (JMenuItem menuItem : subList) subMenu.add(menuItem);
     parentMenu.add(subMenu);
     index = toIndex;
   }
 }
Example #5
0
  public Entity createEntity(String name, PT param) {
    Entity entity = engine.createEntity();
    EntityInfo info = entityInfos.get(name);
    if (info == null) {
      throw new GdxRuntimeException("Entity blueprint with name '" + name + "' not found!");
    }

    for (Map.Entry<String, SafeProperties> entrySet : info.components.entrySet()) {
      ComponentFactory factory = componentFactories.get(entrySet.getKey());
      if (factory != null) {
        factory.run(entity, info.meta, entrySet.getValue(), param);
      } else {
        logger.error("Could not find factory for component '{}'!", entrySet.getKey());
      }
    }
    return entity;
  }
Example #6
0
  /** @return */
  public Component copy() {

    // Deep copy properties and sub-components
    PropertyList newprops = copyProperties();
    ComponentList newcomps = copySubComponents();

    return ComponentFactory.getInstance().createComponent(getName(), newprops, newcomps);
  }
 /** @return a Component instance. */
 protected Component newComponent() {
   Component component = ComponentFactory.newComponent(innerBlocType);
   component.setMedialSelectorListener(getMediaSelectorListener());
   if (isReadOnly()) {
     component.setReadOnly(Boolean.TRUE);
   }
   return component;
 }
 @Test
 public void testSanity() throws Throwable {
   try {
     Message message = ComponentFactory.getMessage();
     assertEquals("uif-message", message.getCssClasses().get(0));
   } catch (NullPointerException e) {
     Assume.assumeNoException("Missing required testing resources, skipping", e);
   }
 }
  /** ******************************************************************************** */
  private void createDirectoryTableScrollPane() {
    Color background;

    m_table = new DirectoryTable(m_tree, ".class");
    m_tableScrollPane = ComponentFactory.createScrollPane(m_table);
    background = UIManager.getColor("pmdTableBackground");

    m_tableScrollPane.getViewport().setBackground(background);
  }
  /** ******************************************************************************** */
  private void createDirectoryTreeScrollPane() {
    Color background;

    m_tree = new DirectoryTree("Rules Repository");
    m_treeScrollPane = ComponentFactory.createScrollPane(m_tree);
    background = UIManager.getColor("pmdTreeBackground");

    m_treeScrollPane.getViewport().setBackground(background);
  }
 @Test
 public void testInquiry() throws Throwable {
   try {
     InquiryView inquiryView = ComponentFactory.getInquiryView();
     assertEquals("uif-formView", inquiryView.getCssClasses().get(0));
   } catch (NullPointerException e) {
     Assume.assumeNoException("Missing required testing resources, skipping", e);
   }
 }
Example #12
0
  /**
   * Creates an object out of a property name. If anything fails, return null.
   *
   * @param p properties
   * @param propName name of class to instantiate.
   * @return null on failure, otherwise, a default constructed instance of the class named in the
   *     property.
   */
  public static Object objectFromProperties(Properties p, String propName) {

    Object ret = null;
    String objectName = p.getProperty(propName);
    if (objectName != null) {
      ret = ComponentFactory.create(objectName);
    }
    return ret;
  }
Example #13
0
 /**
  * Receive any contributions.
  *
  * <p>We need to know when to remove the component so we need a map from the factory to the
  * instance so that when the factory is unregistered, we can dispose it.
  *
  * @param factory The DS Component Factory that can make, well, ehh, components.
  */
 @Reference(type = '*', target = "(component.factory=com.vaadin.Component/contribution)")
 protected void setContribution(ComponentFactory factory) {
   ComponentInstance ci = factory.newInstance(null);
   Component c = (Component) ci.getInstance();
   synchronized (this) {
     tabs.addTab(c);
     mapping.put(factory, ci);
   }
 }
Example #14
0
  public EntityFactory(String filename, Class mainClass) {
    try {
      entityInfos = JacksonReader.readMap(filename, EntityInfo.class);
    } catch (Exception e) {
      throw new IllegalArgumentException("Error parsing entity definitions from json", e);
    }

    try {
      String packageName = mainClass.getPackage().getName();
      for (Class clazz : ClassUtils.findClassesInPackage(packageName)) {
        if (!Modifier.isAbstract(clazz.getModifiers())
            && ComponentFactory.class.isAssignableFrom(clazz)) {
          ComponentFactory factory = (ComponentFactory) clazz.newInstance();
          componentFactories.put(factory.getType(), factory);
        }
      }
    } catch (Exception e) {
      throw new IllegalArgumentException("Error finding component factories", e);
    }
  }
Example #15
0
 /*
  * (non-Javadoc)
  *
  * @see javax.swing.plaf.basic.BasicComboBoxUI#createArrowButton()
  */
 @Override
 protected JButton createArrowButton() {
   JButton button = ComponentFactory.getImageButton(UIImages.DOWN_ICON.getImageIcon());
   button.setToolTipText(arrowButtonTooltip);
   if (arrowButtonBorder == null) {
     button.setBorderPainted(false);
   } else {
     button.setBorderPainted(true);
     button.setBorder(arrowButtonBorder);
   }
   return button;
 }
Example #16
0
    @Override
    public Component tagToComponent(
        String tagName, ComponentFactory componentFactory, DesignContext context) {
      // Extract the package and class names.
      // Otherwise, get the full class name using the prefix to package
      // mapping. Example: "v-vertical-layout" ->
      // "com.vaadin.ui.VerticalLayout"
      String[] parts = tagName.split("-", 2);
      if (parts.length < 2) {
        throw new DesignException("The tagname '" + tagName + "' is invalid: missing prefix.");
      }
      String prefixName = parts[0];
      String packageName = context.getPackage(prefixName);
      if (packageName == null) {
        throw new DesignException("Unknown tag: " + tagName);
      }
      String[] classNameParts = parts[1].split("-");
      String className = "";
      for (String classNamePart : classNameParts) {
        // Split will ignore trailing and multiple dashes but that
        // should be
        // ok
        // <v-button--> will be resolved to <v-button>
        // <v--button> will be resolved to <v-button>
        className += SharedUtil.capitalize(classNamePart);
      }
      String qualifiedClassName = packageName + "." + className;

      Component component = componentFactory.createComponent(qualifiedClassName, context);

      if (component == null) {
        throw new DesignException(
            "Got unexpected null component from "
                + componentFactory.getClass().getName()
                + " for class "
                + qualifiedClassName);
      }

      return component;
    }
  /**
   * ******************************************************************************
   *
   * @param parentWindow
   */
  protected RulesClassSelectDialog(JFrame parentWindow) throws PMDException {
    super(parentWindow, "Rules Class File Selector", true);

    setSize(ComponentFactory.adjustWindowSize(1200, 800));
    setLocationRelativeTo(PMDViewer.getViewer());
    setResizable(true);
    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    createDirectoryTreeScrollPane();
    createDirectoryTableScrollPane();
    createDirectorySplitPane();
    buildTree();
    JPanel buttonPanel = createButtonPanel();
    JPanel contentPanel = new JPanel(new BorderLayout());
    contentPanel.add(m_splitPane, BorderLayout.CENTER);
    contentPanel.add(buttonPanel, BorderLayout.SOUTH);

    getContentPane().add(contentPanel);
  }
  public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    PrintWriter out = response.getWriter();

    response.setContentType("text/html");

    int codigoTipoDoenca = Integer.parseInt(request.getParameter("codTipoDoenca"));

    IManager mgr = ComponentFactory.createInstance();
    IHTMLPageMgt htmlPageMgt = (IHTMLPageMgt) mgr.getRequiredInterface("IHTMLPageMgt");
    try {

      IQueryInfoMgt query = (IQueryInfoMgt) mgr.getRequiredInterface("IQueryInfoMgt");
      IDiseaseDt tp = query.searchDiseaseType(codigoTipoDoenca);

      out.println(htmlPageMgt.open("Queries - Diseases"));
      out.println("<body><h1>Querie result<br>Disease</h1>");

      out.println("<P><h3>Name: " + tp.getName() + "</h3></P>");
      out.println("<P>Description: " + tp.getDescription() + "</P>");
      out.println("<P>How manifests: " + tp.getManifestation() + " </P>");
      out.println("<P>Duration: " + tp.getDuration() + " </P>");
      out.println("<P>Symptoms: </P>");

      Iterator i = tp.getSymptoms().iterator();

      if (!i.hasNext()) {
        out.println("<P>There isn't registered symptoms.</P>");
      } else {
        while (i.hasNext()) {
          ISymptomDt s = (ISymptomDt) i.next();
          out.println("<li> " + s.getDescription() + " </li>");
        }
      }
      out.println(htmlPageMgt.closeQueries());
    } catch (ObjectNotFoundException e) {
      out.println("<P> " + e.getMessage() + " </P>");
    } catch (Exception e) {
      out.println(htmlPageMgt.errorPage("Comunitation error, please try again later."));
      e.printStackTrace(out);
    } finally {
      out.close();
    }
  }
  public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    PrintWriter out = response.getWriter();

    response.setContentType("text/html");

    int codigoEsp = Integer.parseInt(request.getParameter("codEspecialidade"));

    IManager mgr = ComponentFactory.createInstance();
    IHTMLPageMgt htmlPageMgt = (IHTMLPageMgt) mgr.getRequiredInterface("IHTMLPageMgt");
    try {

      IQueryInfoMgt query = (IQueryInfoMgt) mgr.getRequiredInterface("IQueryInfoMgt");
      IteratorDsk repUS = query.searchHealthUnitsBySpeciality(codigoEsp);

      out.println(htmlPageMgt.open("Queries - Health Unit"));
      out.println("<body><h1>Querie result<br>Health units</h1>");

      out.println("<P><h3>Medical specialty: " + codigoEsp + "</h3></P>");
      out.println("<h3>Health units:</h3>");

      if (repUS != null) {
        while (repUS.hasNext()) {
          IHealthUnitDt us = (IHealthUnitDt) repUS.next();
          out.println("<dd><dd>" + us.getDescription());
        }
      }

      out.println(htmlPageMgt.closeQueries());
    } catch (ObjectNotFoundException e) {
      out.println("<P> " + e.getMessage() + " </P>");
    } catch (Exception e) {
      out.println(htmlPageMgt.errorPage("Comunitation error, please try again later."));
      e.printStackTrace(out);
    } finally {
      out.close();
    }
  }
  @Override
  public TogglingLoadBalancer createLoadBalancer(
      ZKConnection zkConnection, ScheduledExecutorService executorService) {
    _log.info("Using d2ServicePath: " + _d2ServicePath);
    ZooKeeperPermanentStore<ClusterProperties> zkClusterRegistry =
        createPermanentStore(
            zkConnection, ZKFSUtil.clusterPath(_baseZKPath), new ClusterPropertiesJsonSerializer());
    ZooKeeperPermanentStore<ServiceProperties> zkServiceRegistry =
        createPermanentStore(
            zkConnection,
            ZKFSUtil.servicePath(_baseZKPath, _d2ServicePath),
            new ServicePropertiesJsonSerializer());
    ZooKeeperEphemeralStore<UriProperties> zkUriRegistry =
        createEphemeralStore(
            zkConnection,
            ZKFSUtil.uriPath(_baseZKPath),
            new UriPropertiesJsonSerializer(),
            new UriPropertiesMerger());

    FileStore<ClusterProperties> fsClusterStore =
        createFileStore("clusters", new ClusterPropertiesJsonSerializer());
    FileStore<ServiceProperties> fsServiceStore =
        createFileStore(_d2ServicePath, new ServicePropertiesJsonSerializer());
    FileStore<UriProperties> fsUriStore =
        createFileStore("uris", new UriPropertiesJsonSerializer());

    PropertyEventBus<ClusterProperties> clusterBus =
        new PropertyEventBusImpl<ClusterProperties>(executorService);
    PropertyEventBus<ServiceProperties> serviceBus =
        new PropertyEventBusImpl<ServiceProperties>(executorService);
    PropertyEventBus<UriProperties> uriBus =
        new PropertyEventBusImpl<UriProperties>(executorService);

    // This ensures the filesystem store receives the events from the event bus so that
    // it can keep a local backup.
    clusterBus.register(fsClusterStore);
    serviceBus.register(fsServiceStore);
    uriBus.register(fsUriStore);

    TogglingPublisher<ClusterProperties> clusterToggle =
        _factory.createClusterToggle(zkClusterRegistry, fsClusterStore, clusterBus);
    TogglingPublisher<ServiceProperties> serviceToggle =
        _factory.createServiceToggle(zkServiceRegistry, fsServiceStore, serviceBus);
    TogglingPublisher<UriProperties> uriToggle =
        _factory.createUriToggle(zkUriRegistry, fsUriStore, uriBus);

    SimpleLoadBalancerState state =
        new SimpleLoadBalancerState(
            executorService,
            uriBus,
            clusterBus,
            serviceBus,
            _clientFactories,
            _loadBalancerStrategyFactories,
            _sslContext,
            _sslParameters,
            _isSSLEnabled,
            _clientServicesConfig);
    SimpleLoadBalancer balancer = new SimpleLoadBalancer(state, _lbTimeout, _lbTimeoutUnit);

    TogglingLoadBalancer togLB =
        _factory.createBalancer(balancer, state, clusterToggle, serviceToggle, uriToggle);
    togLB.start(
        new Callback<None>() {

          @Override
          public void onError(Throwable e) {
            _log.warn(
                "Failed to run start on the TogglingLoadBalancer, may not have registered "
                    + "SimpleLoadBalancer and State with JMX.");
          }

          @Override
          public void onSuccess(None result) {
            _log.info("Registered SimpleLoadBalancer and State with JMX.");
          }
        });
    return togLB;
  }
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    ResourceBundle bundle = ResourceBundle.getBundle("InformationDialog");
    JPanel dialogPane = new JPanel();
    JPanel contentPanel = new JPanel();
    iconLabel = new JLabel();
    pathLabel = new JLabel();
    JLabel labelFrom = new JLabel();
    fieldFrom = new JTextField();
    JLabel labelSize = new JLabel();
    fieldSize = new JTextField();
    JLabel labelDescription = new JLabel();
    JScrollPane scrollPane1 = new JScrollPane();
    descriptionArea = ComponentFactory.getTextArea();
    JPanel optionsPanel = new JPanel();
    JLabel saveToLabel = new JLabel();
    comboPath = new JComboBox();
    btnSelectPath = new JButton();
    progressBar = new JProgressBar();
    JLabel labelRemaining = new JLabel();
    remainingLabel = new JLabel();
    JLabel labelEstimateTime = new JLabel();
    estTimeLabel = new JLabel();
    JLabel labelCurrentSpeed = new JLabel();
    currentSpeedLabel = new JLabel();
    JLabel labelAverageSpeed = new JLabel();
    avgSpeedLabel = new JLabel();
    JXButtonPanel buttonBar = new JXButtonPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    // ======== dialogPane ========
    {
      dialogPane.setBorder(Borders.DIALOG);
      dialogPane.setLayout(new BorderLayout());

      // ======== contentPanel ========
      {

        // ---- iconLabel ----
        iconLabel.setText(bundle.getString("iconLabel.text"));

        // ---- pathLabel ----
        pathLabel.setText(bundle.getString("pathLabel.text"));
        pathLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        // ---- labelFrom ----
        labelFrom.setText(bundle.getString("labelFrom.text"));

        // ---- fieldFrom ----
        fieldFrom.setBorder(null);
        fieldFrom.setOpaque(false);
        fieldFrom.setText(bundle.getString("fieldFrom.text"));

        // ---- labelSize ----
        labelSize.setText(bundle.getString("labelSize.text"));

        // ---- fieldSize ----
        fieldSize.setBorder(null);
        fieldSize.setOpaque(false);

        // ---- labelDescription ----
        labelDescription.setText(bundle.getString("labelDescription.text"));

        // ======== scrollPane1 ========
        {
          scrollPane1.setViewportView(descriptionArea);
        }

        // ======== optionsPanel ========
        {

          // ---- saveToLabel ----
          saveToLabel.setText(bundle.getString("saveToLabel.text"));
          saveToLabel.setLabelFor(comboPath);

          // ---- comboPath ----
          comboPath.setEditable(true);

          // ---- btnSelectPath ----
          btnSelectPath.setText(bundle.getString("btnSelectPath.text"));

          PanelBuilder optionsPanelBuilder =
              new PanelBuilder(
                  new FormLayout(
                      new ColumnSpec[] {
                        FormSpecs.DEFAULT_COLSPEC,
                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                        new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                        FormSpecs.DEFAULT_COLSPEC
                      },
                      RowSpec.decodeSpecs("default")),
                  optionsPanel);

          optionsPanelBuilder.add(saveToLabel, cc.xy(1, 1));
          optionsPanelBuilder.add(comboPath, cc.xy(3, 1));
          optionsPanelBuilder.add(btnSelectPath, cc.xy(5, 1));
        }

        // ---- progressBar ----
        progressBar.setFont(new Font("Tahoma", Font.BOLD, 16));

        // ---- labelRemaining ----
        labelRemaining.setText(bundle.getString("labelRemaining.text"));

        // ---- remainingLabel ----
        remainingLabel.setText(bundle.getString("remainingLabel.text"));
        remainingLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        // ---- labelEstimateTime ----
        labelEstimateTime.setText(bundle.getString("labelEstimateTime.text"));

        // ---- estTimeLabel ----
        estTimeLabel.setText(bundle.getString("estTimeLabel.text"));
        estTimeLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        // ---- labelCurrentSpeed ----
        labelCurrentSpeed.setText(bundle.getString("labelCurrentSpeed.text"));

        // ---- currentSpeedLabel ----
        currentSpeedLabel.setText(bundle.getString("currentSpeedLabel.text"));
        currentSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        // ---- labelAverageSpeed ----
        labelAverageSpeed.setText(bundle.getString("labelAverageSpeed.text"));

        // ---- avgSpeedLabel ----
        avgSpeedLabel.setText(bundle.getString("avgSpeedLabel.text"));
        avgSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        PanelBuilder contentPanelBuilder =
            new PanelBuilder(
                new FormLayout(
                    new ColumnSpec[] {
                      new ColumnSpec(Sizes.dluX(49)),
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      FormSpecs.DEFAULT_COLSPEC,
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      FormSpecs.DEFAULT_COLSPEC,
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      ColumnSpec.decode("max(min;70dlu)")
                    },
                    new RowSpec[] {
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      new RowSpec(
                          RowSpec.FILL,
                          Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(50)),
                          FormSpec.DEFAULT_GROW),
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      RowSpec.decode("fill:max(pref;20dlu)"),
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC
                    }),
                contentPanel);

        contentPanelBuilder.add(iconLabel, cc.xywh(1, 1, 1, 5));
        contentPanelBuilder.add(pathLabel, cc.xywh(3, 1, 7, 1));
        contentPanelBuilder.add(labelFrom, cc.xy(3, 3));
        contentPanelBuilder.add(fieldFrom, cc.xywh(5, 3, 5, 1));
        contentPanelBuilder.add(labelSize, cc.xy(3, 5));
        contentPanelBuilder.add(fieldSize, cc.xywh(5, 5, 3, 1));
        contentPanelBuilder.add(labelDescription, cc.xy(1, 7));
        contentPanelBuilder.add(scrollPane1, cc.xywh(1, 9, 9, 1));
        contentPanelBuilder.add(optionsPanel, cc.xywh(1, 11, 9, 1));
        contentPanelBuilder.add(progressBar, cc.xywh(1, 13, 9, 1));
        contentPanelBuilder.add(labelRemaining, cc.xy(1, 15));
        contentPanelBuilder.add(remainingLabel, cc.xywh(3, 15, 3, 1));
        contentPanelBuilder.add(labelEstimateTime, cc.xy(7, 15));
        contentPanelBuilder.add(estTimeLabel, cc.xy(9, 15));
        contentPanelBuilder.add(labelCurrentSpeed, cc.xy(1, 17));
        contentPanelBuilder.add(currentSpeedLabel, cc.xywh(3, 17, 3, 1));
        contentPanelBuilder.add(labelAverageSpeed, cc.xy(7, 17));
        contentPanelBuilder.add(avgSpeedLabel, cc.xy(9, 17));
      }
      dialogPane.add(contentPanel, BorderLayout.CENTER);

      // ======== buttonBar ========
      {
        buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));

        // ---- okButton ----
        okButton.setText(bundle.getString("okButton.text"));

        // ---- cancelButton ----
        cancelButton.setText(bundle.getString("cancelButton.text"));

        PanelBuilder buttonBarBuilder =
            new PanelBuilder(
                new FormLayout(
                    new ColumnSpec[] {
                      new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                      FormSpecs.UNRELATED_GAP_COLSPEC,
                      ColumnSpec.decode("max(pref;55dlu)"),
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      FormSpecs.DEFAULT_COLSPEC
                    },
                    RowSpec.decodeSpecs("fill:pref")),
                buttonBar);
        ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] {{3, 5}});

        buttonBarBuilder.add(okButton, cc.xy(3, 1));
        buttonBarBuilder.add(cancelButton, cc.xy(5, 1));
      }
      dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
 /** ******************************************************************************** */
 private void createDirectorySplitPane() {
   m_splitPane = ComponentFactory.createHorizontalSplitPane(m_treeScrollPane, m_tableScrollPane);
 }
Example #23
0
 public static TreeView wrap(String componentId) {
   ComponentFactory.ensureXType(XType.TREE_VIEW.getValue(), componentId);
   return new TreeView(Ext.getCmp(componentId).getOrCreateJsObj());
 }
Example #24
0
 public void init(PooledEngine engine, AssetManagerX assetManager) {
   for (ComponentFactory factory : componentFactories.values()) {
     factory.init(engine, assetManager);
   }
   this.engine = engine;
 }