Examples of ColourScheme


Examples of org.locationtech.udig.ui.palette.ColourScheme

            }
        }
       
        String name = paletteSelectionCombo.getItem(paletteSelectionCombo.getSelectionIndex());
        BrewerPalette palette = PlatformGIS.getColorBrewer().getPalette(name);
        mapScheme = new ColourScheme(palette,  Integer.parseInt(quantityCombo.getItem(quantityCombo.getSelectionIndex())) );
        updateLayerDisplay();
    }
View Full Code Here

Examples of org.locationtech.udig.ui.palette.ColourScheme

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public void setColourScheme(ColourScheme newColourScheme) {
        ColourScheme oldColourScheme = colourScheme;
        colourScheme = newColourScheme;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    ProjectPackage.MAP__COLOUR_SCHEME, oldColourScheme, colourScheme));
    }
View Full Code Here

Examples of org.locationtech.udig.ui.palette.ColourScheme

    public ColourScheme createColourSchemeFromString(EDataType eDataType, String initialValue) {
        String[] parts = initialValue.split(";"); //$NON-NLS-1$
        if (parts.length != 4) {
            //something is wrong...
            BrewerPalette palette = PlatformGIS.getColorBrewer().getPalette("Dark2"); //$NON-NLS-1$
            return new ColourScheme(palette, 0);
        }
        String[] strap = parts[2].split(","); //$NON-NLS-1$
        BrewerPalette palette = PlatformGIS.getColorBrewer().getPalette(parts[0]);
        HashMap<Integer, Integer> colourMapping = new HashMap<Integer, Integer>();
        for (int i = 0; i < strap.length; i++) {
            colourMapping.put(i, Integer.parseInt(strap[i]));
        }
        String[] strap2 = parts[3].split(","); //$NON-NLS-1$
        HashMap<String, Integer> idMapping = new HashMap<String, Integer>();
        for (int i = 0; i < strap2.length; i++) {
            idMapping.put(strap2[i], Integer.parseInt(strap2[++i]));
        }
        ColourScheme scheme = new ColourScheme(palette, colourMapping, idMapping, strap.length,
                Integer.parseInt(parts[1]));
        return scheme;
    }
View Full Code Here

Examples of org.locationtech.udig.ui.palette.ColourScheme

     * <!-- begin-user-doc --> <!-- end-user-doc -->
     *
     * @generated NOT
     */
    public String convertColourSchemeToString(EDataType eDataType, Object instanceValue) {
        ColourScheme instance = (ColourScheme) instanceValue;
        String value = instance.getColourPalette().getName() + ";"; //$NON-NLS-1$;
        int numItems = instance.getSizeScheme();
        int numColours = instance.getSizePalette();
        value = value + numColours + ";"; //$NON-NLS-1$
        HashMap colourMap = instance.getColourMap();
        for (int i = 0; i < numItems; i++) {
            if (i > 0)
                value = value + ","; //$NON-NLS-1$
            value = value + colourMap.get(i);
        }
        value = value + ";"; //$NON-NLS-1$
        HashMap<String, Integer> idMap = instance.getIdMap();
        Iterator<Entry<String, Integer>> it = idMap.entrySet().iterator();
        while (it.hasNext()) {
            Entry<String, Integer> entry = it.next();
            value = value + entry.getKey() + "," + entry.getValue(); //$NON-NLS-1$
            if (it.hasNext()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.