在JUNG定制边缘颜色

时间:2015-08-24 09:46:18

标签: java mysql sqlite jung jung2

我正在尝试根据与一个数据库相关的条件自定义边缘。但我无法获得正确的输出。我试过了波纹管代码。

Transformer<String, Paint> edgePaint = new Transformer<String, Paint>() {
        public Paint transform(String s) {
            connection = connection1.dbConnector(); // graph
            try {
                String qr = "select Inter from gene1 where Disease='Breast Neoplasms'";
                PreparedStatement pest = connection.prepareStatement(qr);
                ResultSet rs = pest.executeQuery();
                while (rs.next()) {
                    // for (j = 0; j <= 1; j++) {
                    name2[j] = rs.getString("Inter");}
                    for (j = 0; j <= 30; j++) {
                        if (name2[j] == "direct")

                            return Color.CYAN;
                        else
                            return Color.BLUE;

                }
                rs.close();
                pest.close();
            } catch (Exception e1) {
                // JOptionPane.showMessageDialog(null, e1);

            }
            return null;
        }
    };

任何人都可以帮助我吗

0 个答案:

没有答案