Package psconsole.SymbolList

Examples of psconsole.SymbolList.Symbol


        txtSymbolEditor.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                String s = txtSymbolEditor.getText();
                if (s.isEmpty() || !Character.isLetter(e.getKeyChar())) return;
                Symbol smb = symbolList.search(s);
                if (smb == null) return;
                txtSymbolEditor.setText(smb.symbol);
                txtSymbolEditor.setSelectionStart(s.length());
                txtSymbolEditor.setSelectionEnd(smb.symbol.length());
            }
View Full Code Here


        }
        txtSymbolNameKeyUp(evt);
        String s = txtSybmolName.getText();
        if (s.isEmpty()) { if (lblAddSmb.isEnabled()) lblAddSmb.setEnabled(false); }
        else { if (!lblAddSmb.isEnabled()) lblAddSmb.setEnabled(true); }
        Symbol smb = symbolList.search(s, true);
        if (smb == null) {
            lblAddSmb.setIcon(iconAdd);
            lblAddSmb.setText("Добавить");
        } else if (s.equalsIgnoreCase(smb.symbol)) {
            lblAddSmb.setIcon(iconRemove);
View Full Code Here

    private void txtSymbolNameKeyUp(KeyEvent evt) {
        String s = txtSybmolName.getText();
        if (!Character.isLetter(evt.getKeyChar()) || txtSybmolName.getCaretPosition() < s.length())
            return;
        if (s.isEmpty()) return;
        Symbol smb = symbolList.search(s);
        String sb = (smb == null ? null : smb.symbol);
        if (sb == null) return;
        String add = sb.substring(s.length());
        txtSybmolName.setText(s + add);
        txtSybmolName.setSelectionStart(s.length());
View Full Code Here

    }
   
    private void lblAddSmbMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblAddSmbMouseClicked
        if (!lblAddSmb.isEnabled()) return;
        String s = txtSybmolName.getText();
        Symbol smb = symbolList.search(s, true);
        if (smb == null) {
            symbolList.add(s);
            txtSybmolName.setText("");
        } else if (s.equalsIgnoreCase(smb.symbol)) {
            symbolList.remove(smb);
View Full Code Here

         * @return true, если значение допустимо для указанной ячейки
         */
        public boolean validateCell(Object aValue, int row, int column) {
            switch (column) {
                case 0:
                    Symbol smb = symbolList.search(aValue.toString(), true);
                    return smb != null;
               
                case 1: try { return aValue instanceof TaskOrder.Type; } catch (Exception e) {
                    e.printStackTrace();
                    return false;
                }
               
                case 2:
                    try {
                        double vl = Double.parseDouble(aValue.toString());
                        return vl > 0.0 && vl < 100.0;
                    } catch (Exception e) { return false; }
                   
                   
                case 3: case 4: case 5: case 6: case 7:
                   try {
                        int vl = Integer.parseInt(aValue.toString());
                        if (column < 7) {
                            Symbol sym = symbolList.search(getOrder(row).symbol, true);
                            if (vl == 0 && (column >= 4 || column <= 6)) return true;
                            else return (vl > sym.minSL);
                        } else return (vl > 0);
                    } catch (Exception e) { return false; }
               
View Full Code Here

       
        @Override
        public Object getValueAt(int row, int column) {
            try {
                OrderItem<OrderData> order = getOrder(row);
                Symbol smb = symbolList.search(order.symbol, true);
                if (smb == null) {
                    symbolList.add(order.symbol.toLowerCase());
                    btnExitSettingsActionPerformed(null);
                }
                int dig = smb == null ? 4 : smb.digits;
View Full Code Here

TOP

Related Classes of psconsole.SymbolList.Symbol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.