@Override public void setTo( org.geotools.styling.ChannelSelection sel, org.geotools.styling.SelectedChannelType chan) { sel.setGrayChannel(chan); } },
protected ChannelSelection copy(ChannelSelection channelSelection) { if (channelSelection == null) return null; SelectedChannelType[] channels = copy(channelSelection.getSelectedChannels()); ChannelSelection copy = sf.createChannelSelection(channels); copy.setGrayChannel(copy(channelSelection.getGrayChannel())); copy.setRGBChannels(copy(channelSelection.getRGBChannels())); return copy; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ChannelSelection cs = styleFactory.createChannelSelection(null); if (node.hasChild("GrayChannel")) { cs.setGrayChannel((SelectedChannelType) node.getChildValue("GrayChannel")); } else { SelectedChannelType[] rgb = new SelectedChannelType[] { (SelectedChannelType) node.getChildValue("RedChannel"), (SelectedChannelType) node.getChildValue("GreenChannel"), (SelectedChannelType) node.getChildValue("BlueChannel") }; cs.setRGBChannels(rgb); } return cs; } }
@Override public void setTo( org.geotools.styling.ChannelSelection sel, org.geotools.styling.SelectedChannelType chan) { sel.setGrayChannel(chan); } },
@Override public void handle(YamlObject<?> obj, YamlParseContext context) { YamlMap map = obj.map(); if (map.has(Band.GRAY.key)) { if (map.has(Band.RED.key) || map.has(Band.GREEN.key) || map.has(Band.BLUE.key)) throw new IllegalArgumentException("grey and RGB can not be combined"); SelectedChannelType gray = factory.style.selectedChannelType((String) null, null); selection.setGrayChannel(gray); parse(Band.GRAY, gray, map, context); } else { if (!(map.has(Band.RED.key) && map.has(Band.GREEN.key) && map.has(Band.BLUE.key))) throw new IllegalArgumentException("all of red green and blue must be preset"); SelectedChannelType red = factory.style.selectedChannelType((String) null, null); SelectedChannelType green = factory.style.selectedChannelType((String) null, null); SelectedChannelType blue = factory.style.selectedChannelType((String) null, null); selection.setRGBChannels(red, green, blue); parse(Band.RED, red, map, context); parse(Band.GREEN, green, map, context); parse(Band.BLUE, blue, map, context); } } }
public void apply() { if (channel != null) { if(guiChkRGB.isSelected()){ SelectedChannelType[] sct = new SelectedChannelType[3]; sct[0] = guiRed.getEdited(); sct[1] = guiGreen.getEdited(); sct[2] = guiBlue.getEdited(); }else{ channel.setGrayChannel(guiGray.getEdited()); } } }
chTypeGray.setChannelName("1"); chTypeGray.setContrastEnhancement(cntEnh); chSel.setGrayChannel(chTypeGray); rsb_1.setChannelSelection(chSel); rsb_1.setOpacity(sldBuilder.literalExpression(1.0));
chTypeGray.setChannelName("1"); chTypeGray.setContrastEnhancement(cntEnh); chSel.setGrayChannel(chTypeGray); rsb_1.setChannelSelection(chSel);
chSel.setGrayChannel(chTypeGray);
chTypeGray.setContrastEnhancement(cntEnh); chSel.setGrayChannel(chTypeGray);
protected ChannelSelection copy(ChannelSelection channelSelection) { if( channelSelection == null ) return null; SelectedChannelType[] channels = copy( channelSelection.getSelectedChannels() ); ChannelSelection copy = sf.createChannelSelection( channels); copy.setGrayChannel( copy( channelSelection.getGrayChannel() )); copy.setRGBChannels( copy( channelSelection.getRGBChannels() )); return copy; }
chSel.setGrayChannel(chTypeGray); rsb_1.setChannelSelection(chSel); rsb_1.setOpacity(sldBuilder.literalExpression(1.0)); chSel_2.setGrayChannel(chTypeGray_2); rsb_2.setChannelSelection(chSel_2); rsb_2.setOpacity(sldBuilder.literalExpression(1.0)); chSel_3.setGrayChannel(chTypeGray_3); rsb_3.setChannelSelection(chSel_3); rsb_3.setOpacity(sldBuilder.literalExpression(1.0)); chSel_4.setGrayChannel(chTypeGray_4); rsb_4.setChannelSelection(chSel_4); chSel_4f.setGrayChannel(chTypeGray_4f); rsb_4f.setChannelSelection(chSel_4f); chSel_5.setGrayChannel(chTypeGray_5); rsb_5.setChannelSelection(chSel_5); chSel_5f.setGrayChannel(chTypeGray_5f); rsb_5f.setChannelSelection(chSel_5f); chSel_5g.setGrayChannel(chTypeGray_5g); rsb_5g.setChannelSelection(chSel_5g); chSel_5c.setGrayChannel(chTypeGray_5c); rsb_5c.setChannelSelection(chSel_5c);
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ChannelSelection cs = styleFactory.createChannelSelection(null); if (node.hasChild("GrayChannel")) { cs.setGrayChannel((SelectedChannelType) node.getChildValue("GrayChannel")); } else { SelectedChannelType[] rgb = new SelectedChannelType[] { (SelectedChannelType) node.getChildValue("RedChannel"), (SelectedChannelType) node.getChildValue("GreenChannel"), (SelectedChannelType) node.getChildValue("BlueChannel") }; cs.setRGBChannels(rgb); } return cs; } }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { if ((node.getChild("RedChannel") == null) || (node.getChild("BlueChannel") == null) || (node.getChild("GreenChannel") == null) || (node.getChild("GrayChannel") == null)) { String msg = "All of Red,Blue,Green,Gray must be specified"; throw new RuntimeException(msg); } SelectedChannelType[] rgb = new SelectedChannelType[] { (SelectedChannelType) node.getChildValue("RedChannel"), (SelectedChannelType) node.getChildValue("GreenChannel"), (SelectedChannelType) node.getChildValue("BlueChannel") }; SelectedChannelType gray = (SelectedChannelType) node.getChildValue("GrayChannel"); ChannelSelection cs = styleFactory.createChannelSelection(null); cs.setGrayChannel(gray); cs.setRGBChannels(rgb); return cs; } }
final SelectedChannelType chTypeGray = new SelectedChannelTypeImpl(); chTypeGray.setChannelName("1"); chSel.setGrayChannel(chTypeGray); rsb_1.setChannelSelection(chSel); rsb_1.setOpacity(sldBuilder.literalExpression(1.0));
@Override public void handle(YamlObject<?> obj, YamlParseContext context) { YamlMap map = obj.map(); if (map.has(Band.GRAY.key)) { if (map.has(Band.RED.key) || map.has(Band.GREEN.key) || map.has(Band.BLUE.key)) throw new IllegalArgumentException("grey and RGB can not be combined"); SelectedChannelType gray = factory.style.selectedChannelType((String) null, null); selection.setGrayChannel(gray); parse(Band.GRAY, gray, map, context); } else { if (!(map.has(Band.RED.key) && map.has(Band.GREEN.key) && map.has(Band.BLUE.key))) throw new IllegalArgumentException("all of red green and blue must be preset"); SelectedChannelType red = factory.style.selectedChannelType((String) null, null); SelectedChannelType green = factory.style.selectedChannelType((String) null, null); SelectedChannelType blue = factory.style.selectedChannelType((String) null, null); selection.setRGBChannels(red, green, blue); parse(Band.RED, red, map, context); parse(Band.GREEN, green, map, context); parse(Band.BLUE, blue, map, context); } } }