Package org.gephi.preview.types

Examples of org.gephi.preview.types.DependantOriginalColor


        colorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                Color newColor = (Color) evt.getNewValue();
                propertyEditor.setValue(new DependantOriginalColor(newColor));
            }
        });

        originalRadio.addItemListener(this);
        parentRadio.addItemListener(this);
View Full Code Here


        } else if (parentRadio.isSelected()) {
            selectedMode = DependantOriginalColor.Mode.PARENT;
        } else if (customRadio.isSelected()) {
            selectedMode = DependantOriginalColor.Mode.CUSTOM;
        }
        propertyEditor.setValue(new DependantOriginalColor(selectedMode));
    }
View Full Code Here

    }
    private DependantOriginalColorPropertyEditor propertyEditor;

    public void setup(DependantOriginalColorPropertyEditor propertyEditor) {
        this.propertyEditor = propertyEditor;
        DependantOriginalColor dependantOriginalColor = (DependantOriginalColor) propertyEditor.getValue();
        if (dependantOriginalColor.getMode().equals(DependantOriginalColor.Mode.CUSTOM)) {
            customRadio.setSelected(true);
            ((JColorButton) colorButton).setColor(dependantOriginalColor.getCustomColor());
        } else if (dependantOriginalColor.getMode().equals(DependantOriginalColor.Mode.ORIGINAL)) {
            originalRadio.setSelected(true);
        } else if (dependantOriginalColor.getMode().equals(DependantOriginalColor.Mode.PARENT)) {
            parentRadio.setSelected(true);
        }
    }
View Full Code Here

    public void render(Item item, RenderTarget target, PreviewProperties properties) {
        Edge edge = (Edge) item.getSource();
        //Label
        Color edgeColor = item.getData(EDGE_COLOR);
        Color color = item.getData(EdgeLabelItem.COLOR);
        DependantOriginalColor propColor = properties.getValue(PreviewProperty.EDGE_LABEL_COLOR);
        color = propColor.getColor(edgeColor, color);
        String label = item.getData(EdgeLabelItem.LABEL);
        Float x = item.getData(LABEL_X);
        Float y = item.getData(LABEL_Y);

        //Outline
View Full Code Here

    public void render(Item item, RenderTarget target, PreviewProperties properties) {
        Node node = (Node) item.getSource();
        //Label
        Color nodeColor = item.getData(NODE_COLOR);
        Color color = item.getData(NodeLabelItem.COLOR);
        DependantOriginalColor propColor = properties.getValue(PreviewProperty.NODE_LABEL_COLOR);
        color = propColor.getColor(nodeColor, color);
        String label = item.getData(NodeLabelItem.LABEL);
        Integer fontSize = item.getData(FONT_SIZE);
        Float x = item.getData(NODE_X);
        Float y = item.getData(NODE_Y);
View Full Code Here

*/
public class BasicDependantOriginalColorPropertyEditor extends PropertyEditorSupport {

    @Override
    public String getAsText() {
        DependantOriginalColor c = (DependantOriginalColor) getValue();
        if (c.getMode().equals(DependantOriginalColor.Mode.CUSTOM)) {
            Color color = c.getCustomColor() == null ? Color.BLACK : c.getCustomColor();
            return String.format(
                    "%s [%d,%d,%d]",
                    c.getMode().name().toLowerCase(),
                    color.getRed(),
                    color.getGreen(),
                    color.getBlue());
        } else {
            return c.getMode().name().toLowerCase();
        }

    }
View Full Code Here

            if (m.lookingAt()) {
                int r = Integer.valueOf(m.group(1));
                int g = Integer.valueOf(m.group(2));
                int b = Integer.valueOf(m.group(3));

                setValue(new DependantOriginalColor(new Color(r, g, b)));
            }
        } else if (matchColorMode(s, DependantOriginalColor.Mode.ORIGINAL.name().toLowerCase())) {
            setValue(new DependantOriginalColor(DependantOriginalColor.Mode.ORIGINAL));
        } else if (matchColorMode(s, DependantOriginalColor.Mode.PARENT.name().toLowerCase())) {
            setValue(new DependantOriginalColor(DependantOriginalColor.Mode.PARENT));
        }
    }
View Full Code Here

        //Custom values
        properties.put(PreviewProperty.BACKGROUND_COLOR, Color.BLACK);
        properties.put(PreviewProperty.SHOW_EDGE_LABELS, Boolean.TRUE);
        properties.put(PreviewProperty.SHOW_NODE_LABELS, Boolean.TRUE);
        properties.put(PreviewProperty.NODE_LABEL_COLOR, new DependantOriginalColor(Color.WHITE));
        properties.put(PreviewProperty.EDGE_LABEL_COLOR, new DependantOriginalColor(Color.WHITE));
        properties.put(PreviewProperty.NODE_LABEL_OUTLINE_COLOR, new DependantColor(DependantColor.Mode.PARENT));
        properties.put(PreviewProperty.EDGE_LABEL_OUTLINE_COLOR, new DependantColor(DependantColor.Mode.PARENT));
        properties.put(PreviewProperty.EDGE_OPACITY, 70f);
    }
View Full Code Here

        properties.put(PreviewProperty.EDGE_RESCALE_WEIGHT, Boolean.FALSE);
        properties.put(PreviewProperty.EDGE_OPACITY, 100f);
        properties.put(PreviewProperty.EDGE_RADIUS, 0f);
        properties.put(PreviewProperty.EDGE_THICKNESS, 1f);

        properties.put(PreviewProperty.EDGE_LABEL_COLOR, new DependantOriginalColor(DependantOriginalColor.Mode.ORIGINAL));
        properties.put(PreviewProperty.EDGE_LABEL_FONT, new Font("Arial", Font.PLAIN, 10));
        properties.put(PreviewProperty.EDGE_LABEL_MAX_CHAR, 30);
        properties.put(PreviewProperty.EDGE_LABEL_OUTLINE_COLOR, new DependantColor(Color.WHITE));
        properties.put(PreviewProperty.EDGE_LABEL_OUTLINE_OPACITY, 80f);
        properties.put(PreviewProperty.EDGE_LABEL_OUTLINE_SIZE, 0f);
        properties.put(PreviewProperty.EDGE_LABEL_SHORTEN, false);

        properties.put(PreviewProperty.NODE_BORDER_COLOR, new DependantColor(Color.BLACK));
        properties.put(PreviewProperty.NODE_BORDER_WIDTH, 1.0f);
        properties.put(PreviewProperty.NODE_OPACITY, 100f);

        properties.put(PreviewProperty.NODE_LABEL_BOX_COLOR, new DependantColor(DependantColor.Mode.PARENT));
        properties.put(PreviewProperty.NODE_LABEL_BOX_OPACITY, 100f);
        properties.put(PreviewProperty.NODE_LABEL_COLOR, new DependantOriginalColor(Color.BLACK));
        properties.put(PreviewProperty.NODE_LABEL_FONT, new Font("Arial", Font.PLAIN, 12));
        properties.put(PreviewProperty.NODE_LABEL_MAX_CHAR, 30);
        properties.put(PreviewProperty.NODE_LABEL_OUTLINE_COLOR, new DependantColor(Color.WHITE));
        properties.put(PreviewProperty.NODE_LABEL_OUTLINE_OPACITY, 80f);
        properties.put(PreviewProperty.NODE_LABEL_OUTLINE_SIZE, 0f);
View Full Code Here

TOP

Related Classes of org.gephi.preview.types.DependantOriginalColor

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.