コード例 #1
0
  protected JXTaskPane getResourcesPane() {
    if (resourcesPane == null) {
      resourcesPane = new JXTaskPane(STLConstants.K1062_SEL_RESOURCES.getValue());
      resourcesPane.setUI(new IntelTaskPaneUI());
      // turned off animation because it has some issues with JScrollPane
      // under our current BorderLayout. Basically we use BorderLayout
      // because we want the <code>resourcePane</code> takes all the
      // remainder space. But the animation intends to specify
      // resourcePane's size (fixed size). The confliction between the the
      // LayoutManager and the animation causes issues. So we turned
      // animation off here.
      resourcesPane.setAnimated(false);

      JPanel content = (JPanel) resourcesPane.getContentPane();
      content.setLayout(new BorderLayout());
      resourcesPanel = new JPanel();
      resourcesPanel.setBackground(UIConstants.INTEL_WHITE);
      resourcesPanel.setBorder(
          BorderFactory.createMatteBorder(2, 2, 2, 2, UIConstants.INTEL_BACKGROUND_GRAY));
      resourcesPanel.setLayout(new GridBagLayout());
      JScrollPane listScroller = new JScrollPane(resourcesPanel);
      listScroller.setBorder(null);
      content.add(listScroller, BorderLayout.CENTER);
    }
    return resourcesPane;
  }
コード例 #2
0
  protected JXTaskPane getOverviewPane() {
    if (overviewPane == null) {
      overviewPane = new JXTaskPane(STLConstants.K1060_OUTLINE.getValue());
      overviewPane.setUI(new IntelTaskPaneUI());

      Container content = overviewPane.getContentPane();
      content.setLayout(new BorderLayout());

      graphOutline = new TopologyOutlinePanel(updateService, Fit.WIDTH);
      graphOutline.setBackground(UIConstants.INTEL_WHITE);
      graphOutline.setBorder(
          BorderFactory.createCompoundBorder(
              BorderFactory.createLineBorder(UIConstants.INTEL_GRAY),
              BorderFactory.createEmptyBorder(2, 2, 2, 2)));
      content.add(graphOutline, BorderLayout.CENTER);

      enlargeBtn =
          new JXHyperlink(
              new AbstractAction(STLConstants.K1061_ENLARGE.getValue()) {
                private static final long serialVersionUID = -4493041735258083928L;

                @Override
                public void actionPerformed(ActionEvent e) {
                  if (graph != null) {
                    showOutlineWindow();
                  }
                }
              });
      enlargeBtn.setHorizontalAlignment(JButton.TRAILING);
      enlargeBtn.setUnclickedColor(UIConstants.INTEL_BLUE);
      content.add(enlargeBtn, BorderLayout.SOUTH);
    }
    return overviewPane;
  }
コード例 #3
0
ファイル: InfoProduct.java プロジェクト: ecartago/opensixen
  /** Static Setup - add fields to parameterPanel */
  private void statInit() {
    labelValue.setText(Msg.getMsg(Env.getCtx(), "Value"));
    fieldValue.setBackground(AdempierePLAF.getInfoBackground());
    fieldValue.addActionListener(this);

    labelName.setText(Msg.getMsg(Env.getCtx(), "Name"));
    fieldName.setBackground(AdempierePLAF.getInfoBackground());
    fieldName.addActionListener(this);

    labelUPC.setText(Msg.translate(Env.getCtx(), "UPC"));
    fieldUPC.setBackground(AdempierePLAF.getInfoBackground());
    fieldUPC.addActionListener(this);

    labelSKU.setText(Msg.translate(Env.getCtx(), "SKU"));
    fieldSKU.setBackground(AdempierePLAF.getInfoBackground());
    fieldSKU.addActionListener(this);

    labelWarehouse.setText(Msg.getMsg(Env.getCtx(), "Warehouse"));
    pickWarehouse.setBackground(AdempierePLAF.getInfoBackground());

    labelPriceList.setText(Msg.getMsg(Env.getCtx(), "PriceListVersion"));
    pickPriceList.setBackground(AdempierePLAF.getInfoBackground());

    labelProductCategory.setText(Msg.translate(Env.getCtx(), "M_Product_Category_ID"));
    pickProductCategory.setBackground(AdempierePLAF.getInfoBackground());

    // @Trifon
    labelAS.setText(Msg.translate(Env.getCtx(), "M_AttributeSet_ID"));
    pickAS.setBackground(AdempierePLAF.getInfoBackground());

    m_InfoPAttributeButton.setMargin(new Insets(2, 2, 2, 2));
    m_InfoPAttributeButton.setToolTipText(Msg.getMsg(Env.getCtx(), "InfoPAttribute"));
    m_InfoPAttributeButton.addActionListener(this);

    labelVendor.setText(Msg.translate(Env.getCtx(), "Vendor"));
    fieldVendor.setBackground(AdempierePLAF.getInfoBackground());
    fieldVendor.addActionListener(this);

    //	Line 1
    parameterPanel.setLayout(new ALayout());
    parameterPanel.add(labelValue, new ALayoutConstraint(0, 0));
    parameterPanel.add(fieldValue, null);
    parameterPanel.add(labelUPC, null);
    parameterPanel.add(fieldUPC, null);
    parameterPanel.add(labelWarehouse, null);
    parameterPanel.add(pickWarehouse, null);
    parameterPanel.add(m_InfoPAttributeButton);
    //	Line 2
    parameterPanel.add(labelName, new ALayoutConstraint(1, 0));
    parameterPanel.add(fieldName, null);
    parameterPanel.add(labelSKU, null);
    parameterPanel.add(fieldSKU, null);
    parameterPanel.add(labelVendor, null);
    parameterPanel.add(fieldVendor, null);

    // Line 3
    parameterPanel.add(labelPriceList, new ALayoutConstraint(2, 0));
    parameterPanel.add(pickPriceList, null);
    parameterPanel.add(labelProductCategory, null);
    parameterPanel.add(pickProductCategory, null);
    parameterPanel.add(labelAS, null); // @Trifon
    parameterPanel.add(pickAS, null); // @Trifon

    //	Product Attribute Instance
    m_PAttributeButton = ConfirmPanel.createPAttributeButton(true);
    confirmPanel.addButton(m_PAttributeButton);
    m_PAttributeButton.addActionListener(this);
    m_PAttributeButton.setEnabled(false);

    // Begin - fer_luck @ centuryon
    // add taskpane
    fieldDescription.setBackground(AdempierePLAF.getInfoBackground());
    fieldDescription.setEditable(false);
    fieldDescription.setPreferredSize(new Dimension(INFO_WIDTH - 100, 100));

    warehouseStockPanel.setTitle(Msg.translate(Env.getCtx(), "WarehouseStock"));
    warehouseStockPanel.setUI(new AdempiereTaskPaneUI());
    warehouseStockPanel.getContentPane().setBackground(new ColorUIResource(251, 248, 241));
    warehouseStockPanel.getContentPane().setForeground(new ColorUIResource(251, 0, 0));

    ColumnInfo[] s_layoutWarehouse =
        new ColumnInfo[] {
          new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "Warehouse", String.class),
          new ColumnInfo(
              Msg.translate(Env.getCtx(), "QtyAvailable"), "sum(QtyAvailable)", Double.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "sum(QtyOnHand)", Double.class),
          new ColumnInfo(
              Msg.translate(Env.getCtx(), "QtyReserved"), "sum(QtyReserved)", Double.class),
          new ColumnInfo(
              Msg.translate(Env.getCtx(), "QtyAllocated"), "sum(QtyAllocated)", Double.class)
        };
    /** From Clause */
    String s_sqlFrom = " M_PRODUCT_STOCK_V ";
    /** Where Clause */
    String s_sqlWhere = "Value = ?";
    m_sqlWarehouse =
        warehouseTbl.prepareTable(
            s_layoutWarehouse, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_STOCK_V");
    m_sqlWarehouse += " Group By Warehouse, documentnote ";
    warehouseTbl.setRowSelectionAllowed(true);
    warehouseTbl.setMultiSelection(false);
    warehouseTbl.addMouseListener(this);
    warehouseTbl.getSelectionModel().addListSelectionListener(this);
    warehouseTbl.setShowTotals(true);
    warehouseTbl.autoSize();

    ColumnInfo[] s_layoutSubstitute =
        new ColumnInfo[] {
          new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class),
          new ColumnInfo(
              Msg.translate(Env.getCtx(), "Value"),
              "(Select Value from M_Product p where p.M_Product_ID=M_PRODUCT_SUBSTITUTERELATED_V.Substitute_ID)",
              String.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class)
        };
    s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V";
    s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'S'";
    m_sqlSubstitute =
        substituteTbl.prepareTable(
            s_layoutSubstitute, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V");
    substituteTbl.setRowSelectionAllowed(false);
    substituteTbl.setMultiSelection(false);
    substituteTbl.addMouseListener(this);
    substituteTbl.getSelectionModel().addListSelectionListener(this);
    substituteTbl.autoSize();

    ColumnInfo[] s_layoutRelated =
        new ColumnInfo[] {
          new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class),
          new ColumnInfo(
              Msg.translate(Env.getCtx(), "Value"),
              "(Select Value from M_Product p where p.M_Product_ID=M_PRODUCT_SUBSTITUTERELATED_V.Substitute_ID)",
              String.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class),
          new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class)
        };
    s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V";
    s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'R'";
    m_sqlRelated =
        relatedTbl.prepareTable(
            s_layoutRelated, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V");
    relatedTbl.setRowSelectionAllowed(false);
    relatedTbl.setMultiSelection(false);
    relatedTbl.addMouseListener(this);
    relatedTbl.getSelectionModel().addListSelectionListener(this);
    relatedTbl.autoSize();

    // Available to Promise Tab
    m_tableAtp.setRowSelectionAllowed(false);
    m_tableAtp.setMultiSelection(false);

    CTabbedPane jTab = new CTabbedPane();
    jTab.addTab(Msg.translate(Env.getCtx(), "Warehouse"), new JScrollPane(warehouseTbl));
    jTab.setPreferredSize(new Dimension(INFO_WIDTH, SCREEN_HEIGHT > 600 ? 250 : 105));
    jTab.addTab(Msg.translate(Env.getCtx(), "Description"), new JScrollPane(fieldDescription));
    jTab.addTab(Msg.translate(Env.getCtx(), "Substitute_ID"), new JScrollPane(substituteTbl));
    jTab.addTab(Msg.translate(Env.getCtx(), "RelatedProduct_ID"), new JScrollPane(relatedTbl));
    jTab.addTab(Msg.getMsg(Env.getCtx(), "ATP"), new JScrollPane(m_tableAtp));
    jTab.addChangeListener(this);
    tablePanel.setPreferredSize(new Dimension(INFO_WIDTH, SCREEN_HEIGHT > 600 ? 255 : 110));
    tablePanel.add(jTab);

    warehouseStockPanel.setCollapsed(true);
    warehouseStockPanel.add(tablePanel);
    this.addonPanel.add(warehouseStockPanel);

    this.p_table.addKeyListener(
        new KeyAdapter() {
          public void keyReleased(KeyEvent ke) {
            int row = ((MiniTable) ke.getSource()).getSelectedRow();
            refresh(
                ((MiniTable) ke.getSource()).getValueAt(row, 2),
                new BigDecimal(pickWarehouse.getValue().toString()).intValue(),
                new BigDecimal(pickPriceList.getValue().toString()).intValue());
            warehouseStockPanel.setCollapsed(false);
          }
        });

    this.p_table.addMouseListener(
        new MouseAdapter() {
          public void mouseClicked(MouseEvent me) {
            int row = ((MiniTable) me.getSource()).getSelectedRow();
            refresh(
                ((MiniTable) me.getSource()).getValueAt(row, 2),
                new BigDecimal(pickWarehouse.getValue().toString()).intValue(),
                new BigDecimal(pickPriceList.getValue().toString()).intValue());
            warehouseStockPanel.setCollapsed(false);
          }
        });
    // End - fer_luck @ centuryon
  } //	statInit
コード例 #4
0
  private void buildMenu() {
    JXTaskPane editPane = new JXTaskPane();
    editPane.setTitle("Bearbeiten");
    JXButton filter3k =
        new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/3k.png")));
    filter3k.setToolTipText("Wählt alle Dörfer mit weniger als 3000 Punkten");
    filter3k.addMouseListener(
        new MouseAdapter() {

          @Override
          public void mouseReleased(MouseEvent e) {
            filterByPoints(3000);
          }
        });

    editPane.getContentPane().add(filter3k);

    JXButton filter5k =
        new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/5k.png")));

    filter5k.setToolTipText("Wählt alle Dörfer mit weniger als 5000 Punkten");
    filter5k.addMouseListener(
        new MouseAdapter() {

          @Override
          public void mouseReleased(MouseEvent e) {
            filterByPoints(5000);
          }
        });

    editPane.getContentPane().add(filter5k);
    JXButton filter7k =
        new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/7k.png")));

    filter7k.setToolTipText("Wählt alle Dörfer mit weniger als 7000 Punkten");
    filter7k.addMouseListener(
        new MouseAdapter() {

          @Override
          public void mouseReleased(MouseEvent e) {
            filterByPoints(7000);
          }
        });

    editPane.getContentPane().add(filter7k);

    JXButton filter9k =
        new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/9k.png")));

    filter9k.setToolTipText("Wählt alle Dörfer mit weniger als 9000 Punkten");
    filter9k.addMouseListener(
        new MouseAdapter() {

          @Override
          public void mouseReleased(MouseEvent e) {
            filterByPoints(9000);
          }
        });

    editPane.getContentPane().add(filter9k);

    jApplyCustomFilter.addMouseListener(
        new MouseAdapter() {

          @Override
          public void mouseReleased(MouseEvent e) {
            try {
              filterByPoints(UIHelper.parseIntFromField(jCustomPointsField, 1500));
            } catch (NumberFormatException nfe) {
              jCustomPointsField.setText(null);
            }
          }
        });

    editPane.getContentPane().add(jCustomPointsPanel);

    JXTaskPane transferPane = new JXTaskPane();
    transferPane.setTitle("Übertragen");
    JXButton toHtml =
        new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/att_HTML.png")));

    toHtml.setToolTipText("Gewählte Dörfer als HTML Datei exportieren");
    toHtml.addMouseListener(
        new MouseAdapter() {

          @Override
          public void mouseReleased(MouseEvent e) {
            exportAsHTML();
          }
        });
    transferPane.getContentPane().add(toHtml);

    JXTaskPane miscPane = new JXTaskPane();
    miscPane.setTitle("Sonstiges");
    JXButton structure =
        new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/branch.png")));

    structure.setToolTipText("Wechsel zwischen Baumstruktur und Liste");
    structure.addMouseListener(
        new MouseAdapter() {

          @Override
          public void mouseReleased(MouseEvent e) {
            switchViewType();
          }
        });
    miscPane.getContentPane().add(structure);
    JXButton region =
        new JXButton(
            new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/region_select.png")));

    region.setToolTipText("Auswahl aller Dörfer innerhalb bestimmter Koordinaten");
    region.addMouseListener(
        new MouseAdapter() {

          @Override
          public void mouseReleased(MouseEvent e) {
            showRegionSelection();
          }
        });
    miscPane.getContentPane().add(region);

    JXButton substract =
        new JXButton(
            new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/branch_remove.png")));

    substract.setToolTipText(
        "Abziehen aller Dörfer aus der Zwischenablage von der Liste der ausgewählten Dörfer");
    substract.addMouseListener(
        new MouseAdapter() {

          @Override
          public void mouseReleased(MouseEvent e) {
            substractVillagesFromClipboard();
          }
        });
    miscPane.getContentPane().add(substract);

    centerPanel.setupTaskPane(editPane, transferPane, miscPane);
  }