Example usage for java.awt List size

List of usage examples for java.awt List size

Introduction

In this page you can find the example usage for java.awt List size.

Prototype

@Deprecated
public Dimension size() 

Source Link

Document

Returns the size of this component in the form of a Dimension object.

Usage

From source file:op.care.sysfiles.PnlFiles.java

private CollapsiblePane addCommands() {
    JPanel mypanel = new JPanel();
    mypanel.setLayout(new VerticalLayout());
    mypanel.setBackground(Color.WHITE);

    CollapsiblePane cmdPane = new CollapsiblePane(SYSTools.xx(internalClassID));
    cmdPane.setStyle(CollapsiblePane.PLAIN_STYLE);
    cmdPane.setCollapsible(false);//from  w  w  w .j a  v  a2  s  . c o  m

    try {
        cmdPane.setCollapsed(false);
    } catch (PropertyVetoException e) {
        e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    }

    mypanel.add(GUITools.getDropPanel(new FileDrop.Listener() {
        public void filesDropped(java.io.File[] files) {
            java.util.List<SYSFiles> successful = SYSFilesTools.putFiles(files, resident);
            if (!successful.isEmpty()) {
                OPDE.getDisplayManager().addSubMessage(new DisplayMessage(successful.size() + " "
                        + SYSTools.xx("misc.msg.Files") + " " + SYSTools.xx("misc.msg.added")));
            }
            reloadTable();
        }
    }));

    cmdPane.setContentPane(mypanel);
    return cmdPane;
}

From source file:org.yccheok.jstock.gui.WizardSelectStockJPanel.java

public void updateRadioBoxState() {
    JStock m = JStock.instance();/*from  w ww.j  a va2s . c  o  m*/
    java.util.List<Stock> stocks = m.getStocks();
    jRadioButton4.setEnabled(stocks.size() > 0);
}

From source file:com.neurotec.samples.panels.EnrollFromScanner.java

public void enrollFingerPrints(java.util.List<PatientFingerPrintModel> patientModels) throws IOException {
    NBiometricTask enrollTask = FingersTools.getInstance().getClient()
            .createTask(EnumSet.of(NBiometricOperation.ENROLL), null);
    if (patientModels.size() > 0) {
        for (PatientFingerPrintModel model : patientModels) {
            NTemplate template = createTemplate(model.getFingerprintTemplate());
            enrollTask.getSubjects().add(createSubject(template, model.getPatientUUID()));
        }/* w w w  .j  a v  a  2  s.  co  m*/
        FingersTools.getInstance().getClient().performTask(enrollTask, NBiometricOperation.ENROLL,
                enrollCompletionHandler);
    } else {
        return;
    }

}

From source file:com.jhash.oimadmin.ui.UIJavaCompile.java

@Override
public void initializeComponent() {
    logger.debug("Initializing {}", this);
    this.outputDirectory = configuration.getWorkArea() + Config.VAL_WORK_AREA_CLASSES + File.separator
            + System.currentTimeMillis();
    logger.debug("Compile output directory {}", outputDirectory);
    File templateDirectory = new File(configuration.getWorkArea() + File.separator + Config.VAL_WORK_AREA_CONF
            + File.separator + "templates");
    logger.debug("Trying to validate template directory {} exists and is directory", templateDirectory);
    if (templateDirectory.exists() && templateDirectory.isDirectory()) {
        logger.debug("Trying to list files in directory");
        String[] listOfFile = templateDirectory.list(new FilenameFilter() {
            @Override// w  ww .j  a v  a  2  s. com
            public boolean accept(File dir, String name) {
                logger.trace("Validating file {}", name);
                if (name.startsWith(templatePrefix)) {
                    logger.trace("File {} begins with prefix", name);
                    return true;
                }
                return false;
            }
        });
        java.util.List<String> fixedListOfFile = new ArrayList<>();
        logger.debug("Extract class name and display name from file names {}", listOfFile);
        for (String fileName : listOfFile) {
            String fileSuffix = fileName.replaceAll(templatePrefix, "");
            logger.trace("Adding class {} to list", fileSuffix);
            fixedListOfFile.add(fileSuffix);
        }
        if (fixedListOfFile != null && fixedListOfFile.size() > 0) {
            logger.debug("Creating combo-box with values {}", fixedListOfFile);
            sourceCodeSelector = new JComboBox<String>(fixedListOfFile.toArray(new String[0]));
            sourceCodeSelector.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    logger.debug("Event {} triggered on combo box {}", e, sourceCodeSelector);
                    String sourceCodeSelected = (String) sourceCodeSelector.getSelectedItem();
                    if (sourceCodeSelector != null) {
                        logger.debug("Trying to read file for selected source code {}", sourceCodeSelected);
                        String readData = Utils.readFile(templatePrefix + sourceCodeSelected,
                                templateDirectory.getAbsolutePath());
                        sourceCode.setText(readData);
                        classNameText.setText(sourceCodeSelected);
                    }
                }
            });
            sourceCodeSelector.setSelectedIndex(0);
        }
    }
    compileButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            try {
                logger.debug("Triggered action {} on {}", e, compileButton);
                compile();
                logger.debug("Completed action {} on {}", e, compileButton);
            } catch (Exception exception) {
                displayMessage("Compilation failed", "Failed to compile", exception);
            }
        }
    });
    javaCompileUI = buildCodePanel();
}

From source file:org.apache.tinkerpop.gremlin.driver.ser.GryoBaseMessageSerializerV1d0Test.java

@Test
public void shouldSerializeIterableToString() throws Exception {
    final ArrayList<Integer> list = new ArrayList<>();
    list.add(1);//  w  w w .ja  v a 2  s .  co  m
    list.add(100);

    final ResponseMessage response = convertText(list);
    assertCommon(response);

    final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
    assertEquals(2, deserializedFunList.size());
    assertEquals("1", deserializedFunList.get(0));
    assertEquals("100", deserializedFunList.get(1));
}

From source file:org.apache.tinkerpop.gremlin.driver.ser.GryoBaseMessageSerializerV1d0Test.java

@Test
public void shouldSerializeIterableToStringWithNull() throws Exception {
    final ArrayList<Integer> list = new ArrayList<>();
    list.add(1);//  w w w  . j av  a  2 s .  co m
    list.add(null);
    list.add(100);

    final ResponseMessage response = convertText(list);
    assertCommon(response);

    final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
    assertEquals(3, deserializedFunList.size());
    assertEquals("1", deserializedFunList.get(0).toString());
    assertEquals("null", deserializedFunList.get(1).toString());
    assertEquals("100", deserializedFunList.get(2).toString());
}

From source file:brainflow.app.presentation.controls.FileObjectGroupSelector.java

private void updateFileList() {

    String pattern = regexField.getText();
    if (pattern.equals("")) {
        return;//from   ww w.  j a  v a2 s  .  com
    }

    if (searchType.getSelectedItem() == GLOB) {
        pattern = FileObjectGroupSelector.globToRegexPattern(pattern);
    }

    if (!pattern.startsWith(".*")) {
        pattern = ".*" + pattern;
    }

    java.util.List<FileExplorer.FileObjectNode> fileNodes = explorer.getSelectedNodes();
    java.util.List<FileObject> matchList = new ArrayList<FileObject>();
    //System.out.println("fileNodes.size() " + fileNodes.size());
    for (FileExplorer.FileObjectNode node : fileNodes) {
        matchChildren(node, pattern, matchList, 0);

    }

    DefaultListModel listModel = new DefaultListModel();
    for (int i = 0; i < matchList.size(); i++) {
        listModel.addElement(unambiguousIdentifier(i, matchList));

    }

    fileList.setModel(listModel);

}

From source file:org.apache.tinkerpop.gremlin.driver.ser.GryoBaseMessageSerializerV1d0Test.java

@Test
public void shouldSerializeIterable() throws Exception {
    final ArrayList<Integer> list = new ArrayList<>();
    list.add(1);//from  w  w w  .  ja  v  a 2 s  .  c  o m
    list.add(100);

    final ResponseMessage response = convertBinary(list);
    assertCommon(response);

    final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult()
            .getData();
    assertEquals(2, deserializedFunList.size());
    assertEquals(new Integer(1), deserializedFunList.get(0));
    assertEquals(new Integer(100), deserializedFunList.get(1));
}

From source file:org.apache.tinkerpop.gremlin.driver.ser.GryoBaseMessageSerializerV1d0Test.java

@Test
public void shouldSerializeIterableWithNull() throws Exception {
    final ArrayList<Integer> list = new ArrayList<>();
    list.add(1);/*from w w w . j av  a 2 s . c  o  m*/
    list.add(null);
    list.add(100);

    final ResponseMessage response = convertBinary(list);
    assertCommon(response);

    final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult()
            .getData();
    assertEquals(3, deserializedFunList.size());
    assertEquals(new Integer(1), deserializedFunList.get(0));
    assertNull(deserializedFunList.get(1));
    assertEquals(new Integer(100), deserializedFunList.get(2));
}

From source file:org.ut.biolab.medsavant.client.view.component.ListViewTablePanel.java

public void removeRows(Set<Object> keySet) {
    java.util.List<Integer> rowIndices = new ArrayList<Integer>(keySet.size());
    for (Object key : keySet) {
        Set<Integer> ri = keyRowIndexMap.get(key);
        if (ri != null) {
            rowIndices.addAll(ri);// w  w  w  .  j  av  a 2 s  .com
        }
    }
    removeRows(ArrayUtils.toPrimitive(rowIndices.toArray(new Integer[rowIndices.size()])));
}