idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
10,200 | private List < Coordinate [ ] > getCoordinateArrays ( List < Geometry > geometries ) { List < Coordinate [ ] > res = new ArrayList < Coordinate [ ] > ( ) ; for ( Geometry geometry : geometries ) { res . add ( geometry . getCoordinates ( ) ) ; } return res ; } | Transform the list of geometries into a list of coordinate arrays . |
10,201 | public void onUp ( HumanInputEvent < ? > event ) { if ( ! isRightMouseButton ( event ) ) { ToggleSelectionAction action = new ToggleSelectionAction ( mapWidget , pixelTolerance ) ; action . setPriorityToSelectedLayer ( priorityToSelectedLayer ) ; action . toggleSingle ( getLocation ( event , RenderSpace . SCREEN ) ) ; ... | Toggle selection at the event location . |
10,202 | @ Path ( "/{locale}" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response getTranslations ( @ PathParam ( "locale" ) String locale ) { Map < String , String > messages = getMessages ( locale ) ; if ( ! messages . isEmpty ( ) ) { return Response . ok ( messages ) . build ( ) ; } return Response . ok ( "{}" ) . ... | Returns a map of key translation for the given locale . |
10,203 | public Translation getTranslation ( String locale ) { LocaleCodeSpecification . assertCode ( locale ) ; return this . getTranslations ( ) . get ( locale ) ; } | Returns the translation corresponding to the given locale code . |
10,204 | public void removeTranslation ( String locale ) { LocaleCodeSpecification . assertCode ( locale ) ; Translation translation = getTranslation ( locale ) ; if ( translation != null ) { this . translations . remove ( translation . getId ( ) ) ; } } | Removes the translation corresponding to the given locale code . |
10,205 | public void checkOutdatedStatus ( ) { boolean newStatus = false ; for ( Translation translation : translations . values ( ) ) { if ( translation . isOutdated ( ) ) { newStatus = true ; break ; } } outdated = newStatus ; } | Checks if the key has outdated translations and then update the outdated status of the key . |
10,206 | public Map < String , Translation > getTranslations ( ) { Map < String , Translation > map = new HashMap < > ( ) ; for ( Map . Entry < TranslationId , Translation > translationEntry : translations . entrySet ( ) ) { map . put ( translationEntry . getKey ( ) . getLocale ( ) , translationEntry . getValue ( ) ) ; } return... | Returns the translation set . |
10,207 | public org . geomajas . geometry . Bbox toDtoBbox ( ) { return new org . geomajas . geometry . Bbox ( getX ( ) , getY ( ) , getWidth ( ) , getHeight ( ) ) ; } | Convert the GWT bounding box to a DTO bounding box . |
10,208 | public Coordinate [ ] getCoordinates ( ) { Coordinate [ ] result = new Coordinate [ 5 ] ; result [ 0 ] = new Coordinate ( x , y ) ; result [ 1 ] = new Coordinate ( x + width , y ) ; result [ 2 ] = new Coordinate ( x + width , y + height ) ; result [ 3 ] = new Coordinate ( x , y + height ) ; result [ 4 ] = new Coordinat... | Get the coordinates of the bounding box as an array . |
10,209 | public boolean contains ( Bbox other ) { if ( other . getX ( ) < this . getX ( ) ) { return false ; } if ( other . getY ( ) < this . getY ( ) ) { return false ; } if ( other . getEndPoint ( ) . getX ( ) > this . getEndPoint ( ) . getX ( ) ) { return false ; } if ( other . getEndPoint ( ) . getY ( ) > this . getEndPoint... | Does this bounding box contain the given bounding box? |
10,210 | public boolean intersects ( Bbox other ) { if ( other . getX ( ) > this . getEndPoint ( ) . getX ( ) ) { return false ; } if ( other . getY ( ) > this . getEndPoint ( ) . getY ( ) ) { return false ; } if ( other . getEndPoint ( ) . getX ( ) < this . getX ( ) ) { return false ; } if ( other . getEndPoint ( ) . getY ( ) ... | Does this bounding box intersect the given bounding box? |
10,211 | public Bbox intersection ( Bbox other ) { if ( ! this . intersects ( other ) ) { return null ; } else { double minx = other . getX ( ) > this . getX ( ) ? other . getX ( ) : this . getX ( ) ; double maxx = other . getEndPoint ( ) . getX ( ) < this . getEndPoint ( ) . getX ( ) ? other . getEndPoint ( ) . getX ( ) : this... | Computes the intersection of this bounding box with the specified bounding box . |
10,212 | public Bbox buffer ( double range ) { if ( range > 0 ) { double r2 = range * 2 ; return new Bbox ( x - range , y - range , width + r2 , height + r2 ) ; } return null ; } | Return a new bounding box that has increased in size by adding a range to this bounding box . |
10,213 | public Bbox transform ( Matrix t ) { Coordinate c1 = transform ( t , new Coordinate ( x , y ) ) ; Coordinate c2 = transform ( t , new Coordinate ( x + width , y + height ) ) ; Coordinate origin = new Coordinate ( Math . min ( c1 . getX ( ) , c2 . getX ( ) ) , Math . min ( c1 . getY ( ) , c2 . getY ( ) ) ) ; Coordinate ... | Create a new bounds by transforming this bounds with the specified tranformation matrix . |
10,214 | public void setCenterPoint ( Coordinate coordinate ) { this . x = coordinate . getX ( ) - 0.5 * this . width ; this . y = coordinate . getY ( ) - 0.5 * this . height ; } | Moves center to the specified coordinate . |
10,215 | public MapController getMapController ( ) { final GraphicsController controller = mapWidget . getController ( ) ; MapController mapController = new MapController ( this , controller ) ; mapController . setActivationHandler ( new ExportableFunction ( ) { public void execute ( ) { controller . onActivate ( ) ; } } ) ; ma... | Return the currently active controller on the map . |
10,216 | public void registerPainter ( Painter painter ) { if ( painters . containsKey ( painter . getPaintableClassName ( ) ) ) { List < Painter > list = painters . remove ( painter . getPaintableClassName ( ) ) ; list . add ( painter ) ; this . painters . put ( painter . getPaintableClassName ( ) , list ) ; } else { List < Pa... | Register a new painter to this visitor . |
10,217 | public void unregisterPainter ( Painter painter ) { String className = painter . getPaintableClassName ( ) ; if ( painters . containsKey ( className ) ) { List < Painter > list = painters . remove ( className ) ; if ( list . size ( ) > 1 ) { list . remove ( painter ) ; painters . put ( className , list ) ; } } } | Unregister an existing painter from this visitor . |
10,218 | public void visit ( Paintable paintable , Object group ) { if ( context . isReady ( ) ) { String className = paintable . getClass ( ) . getName ( ) ; if ( painters . containsKey ( className ) ) { List < Painter > list = painters . get ( className ) ; for ( Painter painter : list ) { painter . paint ( paintable , group ... | The visitors visit function . |
10,219 | public void remove ( Paintable paintable , Object group ) { String className = paintable . getClass ( ) . getName ( ) ; if ( painters . containsKey ( className ) ) { List < Painter > list = painters . get ( className ) ; for ( Painter painter : list ) { painter . deleteShape ( paintable , group , context ) ; } } } | Remove a paintable object from the graphics . |
10,220 | public List < Painter > getPaintersForObject ( Paintable paintable ) { String className = paintable . getClass ( ) . getName ( ) ; if ( painters . containsKey ( className ) ) { return painters . get ( className ) ; } return null ; } | Retrieve the full list of painter for a specific type of paintable object . |
10,221 | public static AssociationValue createEmptyAssociationValue ( AssociationAttributeInfo attributeInfo ) { AssociationValue value = new AssociationValue ( ) ; Map < String , Attribute < ? > > attributes = new HashMap < String , Attribute < ? > > ( ) ; for ( AbstractAttributeInfo attrInfo : attributeInfo . getFeature ( ) .... | Creates an empty association value . An empty association value is a value for which the attributes and identifier are empty . |
10,222 | public static Attribute < ? > createEmptyAttribute ( AbstractAttributeInfo attrInfo ) { if ( attrInfo instanceof PrimitiveAttributeInfo ) { return createEmptyPrimitiveAttribute ( ( PrimitiveAttributeInfo ) attrInfo ) ; } else if ( attrInfo instanceof AssociationAttributeInfo ) { return createEmptyAssociationAttribute (... | Creates an empty attribute . An empty attribute is an attribute which has null as its value . |
10,223 | public static PrimitiveAttribute < ? > createEmptyPrimitiveAttribute ( PrimitiveAttributeInfo info ) { PrimitiveAttribute < ? > attribute ; switch ( info . getType ( ) ) { case BOOLEAN : attribute = new BooleanAttribute ( ) ; break ; case SHORT : attribute = new ShortAttribute ( ) ; break ; case INTEGER : attribute = n... | Creates an empty primitive attribute . An empty attribute is an attribute which has null as its value . |
10,224 | public static AssociationAttribute < ? > createEmptyAssociationAttribute ( AssociationAttributeInfo info ) { AssociationAttribute < ? > association ; switch ( info . getType ( ) ) { case MANY_TO_ONE : association = new ManyToOneAttribute ( ) ; break ; case ONE_TO_MANY : association = new OneToManyAttribute ( ) ; break ... | Creates an empty association attribute . An empty attribute is an attribute which has null as its value . |
10,225 | public JsHandlerRegistration addLayersModelChangedHandler ( final LayersModelChangedHandler handler ) { HandlerRegistration registration = ( ( MapImpl ) map ) . getMapWidget ( ) . getMapModel ( ) . addMapModelChangedHandler ( new MapModelChangedHandler ( ) { public void onMapModelChanged ( MapModelChangedEvent event ) ... | Add a handler to change events in the layer configuration from the map . This event is fired for example when the map gets it s configuration from the server . Only then can it know what layers it has available . |
10,226 | public JsHandlerRegistration addFeatureSelectionHandler ( final FeatureSelectedHandler selectedHandler , final FeatureDeselectedHandler deselectedHandler ) { if ( ( ( MapImpl ) map ) . getMapWidget ( ) . getMapModel ( ) . isInitialized ( ) ) { return addFeatureSelectionHandler2 ( selectedHandler , deselectedHandler ) ;... | Add a handler for feature selection . |
10,227 | public String hyphenate ( String text , Character shy , Character zwsp ) throws StandardHyphenationException { if ( shy == null && zwsp == null ) return text ; byte [ ] hyphens = hyphenate ( text ) ; StringBuffer hyphenatedText = new StringBuffer ( ) ; int i ; for ( i = 0 ; i < hyphens . length ; i ++ ) { hyphenatedTex... | Returns the fully hyphenated string . The given hyphen characters are inserted at all possible hyphenation points . |
10,228 | public byte [ ] hyphenate ( String text ) throws StandardHyphenationException { Matcher matcher = Pattern . compile ( "['\\p{L}]+" ) . matcher ( text ) ; StringBuffer hyphenBuffer = new StringBuffer ( ) ; int pos = 0 ; while ( matcher . find ( ) ) { int start = matcher . start ( ) ; int end = matcher . end ( ) ; while ... | Returns all possible hyphenation opportunities within a string |
10,229 | private static Charset getCharset ( File dictionaryFile ) throws UnsupportedCharsetException , FileNotFoundException { Charset cs = charsets . get ( dictionaryFile ) ; if ( cs == null ) { BufferedReader reader = null ; try { reader = new BufferedReader ( new FileReader ( dictionaryFile ) ) ; String charsetName = reader... | Reads the first line of the dictionary file which is the encoding |
10,230 | protected void resetIcons ( ) { for ( ViewConfigItem item : viewConfigItems ) { RangeConfig config = getRangeConfigForCurrentScale ( item . getViewConfig ( ) , mapWidget . getMapModel ( ) . getMapView ( ) . getCurrentScale ( ) ) ; if ( null != config && null != config . getIcon ( ) ) { ( ( MenuItem ) item . getButton (... | Reset all icons . |
10,231 | private void loginUser ( final String userId , final String password , final BooleanCallback callback ) { LoginRequest request = new LoginRequest ( ) ; request . setLogin ( userId ) ; request . setPassword ( password ) ; GwtCommand command = new GwtCommand ( loginCommandName ) ; command . setCommandRequest ( request ) ... | Effectively log in a certain user . |
10,232 | public void accept ( PainterVisitor visitor , Object group , Bbox bounds , boolean recursive ) { applyPosition ( ) ; map . getVectorContext ( ) . drawGroup ( group , this ) ; map . getVectorContext ( ) . drawImage ( this , background . getId ( ) , background . getHref ( ) , background . getBounds ( ) , ( PictureStyle )... | Apply the correct positions on all panning buttons and render them . |
10,233 | public void fetch ( final String filter , final TileFunction < VectorTile > callback ) { final GetVectorTileRequest request = createRequest ( filter ) ; GwtCommand command = new GwtCommand ( GetVectorTileRequest . COMMAND ) ; command . setCommandRequest ( request ) ; final VectorTile self = this ; lastRequest = request... | Fetch all data related to this tile . |
10,234 | public void apply ( final String filter , final TileFunction < VectorTile > callback ) { switch ( getStatus ( ) ) { case EMPTY : fetch ( filter , callback ) ; break ; case LOADING : if ( needsReload ( filter ) ) { deferred . cancel ( ) ; fetch ( filter , callback ) ; } else { final VectorTile self = this ; deferred . a... | Execute a TileFunction on this tile . If the tile is not yet loaded attach it to the isLoaded event . |
10,235 | public void moveToBack ( Object parent , String name ) { Element parentElement = getGroup ( parent ) ; if ( parentElement == null ) { throw new IllegalArgumentException ( "moveToBack failed: could not find parent group." ) ; } Element element = getElement ( parent , name ) ; if ( element == null ) { throw new IllegalAr... | Within a certain group move an element to the back . All siblings will be rendered after this one . |
10,236 | private void applyAbsolutePosition ( Element element , Coordinate position ) { Dom . setStyleAttribute ( element , "position" , "absolute" ) ; Dom . setStyleAttribute ( element , "left" , ( int ) position . getX ( ) + "px" ) ; Dom . setStyleAttribute ( element , "top" , ( int ) position . getY ( ) + "px" ) ; } | Apply an absolute position on an element . |
10,237 | private void applyElementSize ( Element element , int width , int height , boolean addCoordSize ) { if ( width >= 0 && height >= 0 ) { if ( addCoordSize ) { Dom . setElementAttribute ( element , "coordsize" , width + " " + height ) ; } Dom . setStyleAttribute ( element , "width" , width + "px" ) ; Dom . setStyleAttribu... | Apply a size on an element . |
10,238 | private String parse ( Matrix matrix ) { String transform = "" ; if ( matrix != null ) { double dx = matrix . getDx ( ) ; double dy = matrix . getDy ( ) ; if ( matrix . getXx ( ) != 0 && matrix . getYy ( ) != 0 && matrix . getXx ( ) != 1 && matrix . getYy ( ) != 1 ) { transform += "scale(" + matrix . getXx ( ) + ", " +... | Parse a matrix object into a string suitable for the SVG transform attribute . |
10,239 | protected Element createGroup ( String namespace , Object parent , Object group , String type ) { Element parentElement ; if ( parent == null ) { parentElement = getRootElement ( ) ; } else { parentElement = getGroup ( parent ) ; } if ( parentElement == null ) { return null ; } else { Element element ; String id = Dom ... | Generic creation method for group elements . |
10,240 | protected Element getElement ( Object parent , String name ) { if ( name == null ) { return null ; } String id ; if ( parent == null ) { id = getRootElement ( ) . getId ( ) ; } else { id = groupToId . get ( parent ) ; } return Dom . getElementById ( Dom . assembleId ( id , name ) ) ; } | Returns the element that is a child of the specified parent and has the specified local group name . |
10,241 | protected Element createElement ( Object parent , String name , String type , Style style , boolean generateId ) { if ( null == name ) { return null ; } Element parentElement ; if ( parent == null ) { parentElement = getRootElement ( ) ; } else { parentElement = getGroup ( parent ) ; } if ( parentElement == null ) { re... | Generic creation method for non - group elements . |
10,242 | public void deleteGroup ( Object object ) { Element element = getGroup ( object ) ; if ( element != null ) { Element parent = ( Element ) element . getParentElement ( ) ; if ( parent != null ) { deleteRecursively ( parent , element ) ; } } } | Delete this group from the graphics DOM structure . |
10,243 | public void applyStyle ( Element element , Style style ) { if ( element != null && style != null ) { switch ( namespace ) { case VML : VmlStyleUtil . applyStyle ( element , style ) ; break ; case SVG : if ( style instanceof ShapeStyle ) { applySvgStyle ( element , ( ShapeStyle ) style ) ; } else if ( style instanceof F... | Apply the style . |
10,244 | public void onFailure ( ) throws InterruptedException { int val = currentFailureCount . incrementAndGet ( ) ; if ( val > 50 ) { currentFailureCount . compareAndSet ( val , MAX_FAILURE_COUNT ) ; val = MAX_FAILURE_COUNT ; } int delay = MIN_DELAY + ( ( MAX_DELAY - MIN_DELAY ) / MAX_FAILURE_COUNT ) * val ; synchronized ( t... | Called on failure wait required time before exiting method |
10,245 | public void onFailureNoWait ( ) { Logger . d ( TAG , "onFailureNoWait" ) ; int val = currentFailureCount . incrementAndGet ( ) ; if ( val > 50 ) { currentFailureCount . compareAndSet ( val , MAX_FAILURE_COUNT ) ; val = MAX_FAILURE_COUNT ; } } | onFailure without waiting |
10,246 | public void showGeometricInfo ( ) { FeatureTransaction ft = getFeatureTransaction ( ) ; if ( infoLabel == null && ft != null && ft . getNewFeatures ( ) != null && ft . getNewFeatures ( ) . length > 0 ) { infoLabel = new GeometricInfoLabel ( ) ; infoLabel . addClickHandler ( new DestroyLabelInfoOnClick ( ) ) ; infoLabel... | Show an overview of geometric attributes of the geometry that s being edited . |
10,247 | public void updateGeometricInfo ( ) { FeatureTransaction ft = getFeatureTransaction ( ) ; if ( infoLabel != null && ft != null && ft . getNewFeatures ( ) != null && ft . getNewFeatures ( ) . length > 0 ) { infoLabel . setGeometry ( ft . getNewFeatures ( ) [ 0 ] . getGeometry ( ) ) ; } } | Update the overview of geometric attributes of the geometry that s being edited . |
10,248 | public void onClick ( MenuItemClickEvent event ) { FeatureTransaction featureTransaction = mapWidget . getMapModel ( ) . getFeatureEditor ( ) . getFeatureTransaction ( ) ; if ( featureTransaction != null ) { controller . cleanup ( ) ; mapWidget . render ( featureTransaction , RenderGroup . VECTOR , RenderStatus . DELET... | Cancels editing and also removes the FeatureTransaction object from the map . |
10,249 | public void configure ( String key , String value ) { if ( "x" . equalsIgnoreCase ( key ) ) { xText = value ; } else if ( "y" . equalsIgnoreCase ( key ) ) { yText = value ; } } | Can accept X and Y text values to be printed out . |
10,250 | public void paint ( Paintable paintable , Object group , MapContext context ) { FeatureTransaction featureTransaction = ( FeatureTransaction ) paintable ; Feature [ ] features = featureTransaction . getNewFeatures ( ) ; if ( features == null ) { return ; } context . getVectorContext ( ) . drawGroup ( mapWidget . getGro... | The actual painting function . |
10,251 | public void setScales ( Double ... scales ) { Arrays . sort ( scales , Collections . reverseOrder ( ) ) ; scaleList = Arrays . asList ( scales ) ; updateScaleList ( ) ; } | Set the specified relative scale values in the select item . |
10,252 | public void onKeyPress ( KeyPressEvent event ) { String name = event . getKeyName ( ) ; if ( KeyNames . ENTER . equals ( name ) ) { reorderValues ( ) ; } } | Make sure that the scale in the scale select is applied on the map when the user presses the Enter key . |
10,253 | public void onChanged ( ChangedEvent event ) { String value = ( String ) scaleItem . getValue ( ) ; Double scale = valueToScale . get ( value ) ; if ( scale != null && ! Double . isNaN ( pixelLength ) && 0.0 != pixelLength ) { mapView . setCurrentScale ( scale / pixelLength , MapView . ZoomOption . LEVEL_CLOSEST ) ; } ... | When the user selects a different scale have the map zoom to it . |
10,254 | private void updateScaleList ( ) { refreshPixelLength ( ) ; valueToScale . clear ( ) ; if ( ! Double . isNaN ( pixelLength ) && ( 0.0 != pixelLength ) ) { for ( Double scale : scaleList ) { if ( scale != null ) { String value = ScaleConverter . scaleToString ( scale , precision , significantDigits ) ; valueToScale . pu... | Given the full list of desirable resolutions which ones are actually available? Update the widget accordingly . |
10,255 | public void outdated_scenario ( ) throws JSONException { httpPost ( "keys" , jsonKey . toString ( ) , 201 ) ; try { sendTranslationUpdate ( "zztranslation" , EN , true ) ; sendTranslationUpdate ( "translation" , FR , true ) ; jsonKey . put ( "translation" , "updated translation" ) ; httpPut ( "keys/" + keyName , jsonKe... | Checks the outdated scenario . 1 ) A key is added 2 ) Add fr translation 3 ) Update default translation = > key become outdated 4 ) Update en translation = > key is still outdated 5 ) Update fr translation = > key is no longer outdated |
10,256 | private Response assertOutdatedStatus ( boolean outdated ) throws JSONException { Response response = httpGet ( "keys/" + keyName ) ; JSONObject actual = new JSONObject ( response . asString ( ) ) ; Assertions . assertThat ( actual . getBoolean ( "outdated" ) ) . isEqualTo ( outdated ) ; return response ; } | Checks the outdated state of the key . |
10,257 | private void sendTranslationUpdate ( String translation , String locale , boolean outdated ) throws JSONException { JSONObject jsonTranslationValueObject = new JSONObject ( ) ; jsonTranslationValueObject . put ( "translation" , translation ) ; jsonTranslationValueObject . put ( "outdated" , outdated ) ; jsonTranslation... | Sends an HTTP put request to update the translation for the given locale . |
10,258 | public void getSnappingSources ( final GeometryArrayFunction callback ) { GwtCommand commandRequest = new GwtCommand ( SearchByLocationRequest . COMMAND ) ; SearchByLocationRequest request = new SearchByLocationRequest ( ) ; request . addLayerWithFilter ( layer . getServerLayerId ( ) , layer . getServerLayerId ( ) , la... | Get the geometries of all features within the map view bounds . |
10,259 | public static void foreach ( String path , Consumer < ? super String > block ) { Ruby . Enumerator . of ( new EachLineIterable ( new File ( path ) ) ) . each ( block ) ; } | Iterates a file line by line . |
10,260 | public void close ( ) { try { raFile . close ( ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE , null , e ) ; throw new RuntimeException ( e ) ; } } | Closes this IO . |
10,261 | public void puts ( String words ) { if ( mode . isWritable ( ) == false ) throw new IllegalStateException ( "IOError: not opened for writing" ) ; try { raFile . write ( words . getBytes ( ) ) ; raFile . writeBytes ( System . getProperty ( "line.separator" ) ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE ... | Writes a line in the file . |
10,262 | public String read ( ) { if ( mode . isReadable ( ) == false ) throw new IllegalStateException ( "IOError: not opened for reading" ) ; StringBuilder sb = new StringBuilder ( ) ; try { BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ; char [ ] buf = new char [ 1024 ] ; int numOfChars = 0 ; while (... | Reads the content of a file . |
10,263 | public void seek ( long pos ) { try { raFile . seek ( pos ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE , null , e ) ; throw new RuntimeException ( e ) ; } } | Moves the cursor to certain position . |
10,264 | public int write ( String words ) { if ( mode . isWritable ( ) == false ) throw new IllegalStateException ( "IOError: not opened for writing" ) ; try { raFile . write ( words . getBytes ( ) ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE , null , e ) ; throw new RuntimeException ( e ) ; } return words . g... | Writes to the file . |
10,265 | public Layer getLayer ( String layerId ) { org . geomajas . gwt . client . map . layer . Layer < ? > layer = mapModel . getLayer ( layerId ) ; if ( layer instanceof org . geomajas . gwt . client . map . layer . VectorLayer ) { return new VectorLayer ( ( org . geomajas . gwt . client . map . layer . VectorLayer ) layer ... | Get a single layer by its identifier . |
10,266 | public Layer getLayerAt ( int index ) { org . geomajas . gwt . client . map . layer . Layer < ? > layer = mapModel . getLayers ( ) . get ( index ) ; if ( layer instanceof org . geomajas . gwt . client . map . layer . VectorLayer ) { return new VectorLayer ( ( org . geomajas . gwt . client . map . layer . VectorLayer ) ... | Return the layer at a certain index . If the index can t be found null is returned . |
10,267 | public Geometry execute ( Geometry geometry ) { if ( geometry instanceof Polygon ) { Polygon polygon = ( Polygon ) geometry ; if ( geometry . isEmpty ( ) ) { return null ; } else { LinearRing [ ] interiorRings = new LinearRing [ polygon . getNumInteriorRing ( ) + 1 ] ; int count = 0 ; for ( int n = 0 ; n < interiorRing... | Execute the operation! When the geometry is not a Polygon null is returned . |
10,268 | public FormItem createItem ( AbstractReadOnlyAttributeInfo info ) { return AttributeFormFieldRegistry . createFormItem ( info , attributeProvider . createProvider ( info . getName ( ) ) ) ; } | Creates a form item for a specific attribute . |
10,269 | public void setValue ( String name , BooleanAttribute attribute ) { FormItem item = formWidget . getField ( name ) ; if ( item != null ) { item . setValue ( attribute . getValue ( ) ) ; } } | Apply a boolean attribute value on the form with the given name . |
10,270 | public void setValue ( String name , ShortAttribute attribute ) { FormItem item = formWidget . getField ( name ) ; if ( item != null ) { item . setValue ( attribute . getValue ( ) ) ; } } | Apply a short attribute value on the form with the given name . |
10,271 | public void onClick ( MenuItemClickEvent event ) { final FeatureTransaction ft = mapWidget . getMapModel ( ) . getFeatureEditor ( ) . getFeatureTransaction ( ) ; if ( ft != null ) { SimpleFeatureAttributeWindow window = new SimpleFeatureAttributeWindow ( ft . getNewFeatures ( ) [ 0 ] ) { public void onOk ( Feature feat... | Remove an existing ring from a Polygon or MultiPolygon at a given index . |
10,272 | public void savePage ( WizardView view , Runnable successCallback , Runnable failureCallback ) { if ( null != successCallback ) { successCallback . run ( ) ; } } | Save the page data . This can communicate with the server if needed . The return is handled by calling either the success or failure callback . |
10,273 | public boolean canShow ( ) { WizardPage < DATA > back = getPreviousPage ( ) ; while ( back != null && back . isValid ( ) ) { back = back . getPreviousPage ( ) ; } return back == null ; } | Returns whether this page can already be shown to the user . Default implementation checks whether all previous pages have been validated . |
10,274 | private void buildGui ( ) { setTitle ( I18nProvider . getGlobal ( ) . commandError ( ) ) ; setHeaderIcon ( WidgetLayout . iconError ) ; setIsModal ( true ) ; setShowModalMask ( true ) ; setModalMaskOpacity ( WidgetLayout . modalMaskOpacity ) ; setWidth ( WidgetLayout . exceptionWindowWidth ) ; setHeight ( WidgetLayout ... | Build the entire GUI for this widget . |
10,275 | private VLayout createErrorLayout ( ExceptionDto error ) { VLayout layout = new VLayout ( ) ; layout . setWidth100 ( ) ; layout . setHeight100 ( ) ; layout . setPadding ( WidgetLayout . marginLarge ) ; HLayout topLayout = new HLayout ( WidgetLayout . marginLarge ) ; topLayout . setWidth100 ( ) ; Img icon = new Img ( Wi... | Create the GUI for a single exception . |
10,276 | private void setDetailsVisible ( boolean detailsVisible ) { detailsLayout . setVisible ( detailsVisible ) ; if ( detailsVisible ) { setAutoSize ( false ) ; expandButton . setTitle ( MESSAGES . exceptionDetailsHide ( ) ) ; setHeight ( WidgetLayout . exceptionWindowHeightDetails ) ; } else { expandButton . setTitle ( MES... | Toggle the visibility of the exception details . |
10,277 | public static String tagClassHtmlContent ( String tag , String clazz , String ... content ) { return openTagClassHtmlContent ( tag , clazz , content ) + closeTag ( tag ) ; } | Build a String containing a HTML opening tag with given CSS class HTML content and closing tag . |
10,278 | public static String openTagClassHtmlContent ( String tag , String clazz , String ... content ) { return openTagHtmlContent ( tag , clazz , null , content ) ; } | Build a String containing a HTML opening tag with given CSS class and concatenates the given HTML content . |
10,279 | public void clearSelectedFeatures ( ) { List < Feature > clone = new LinkedList < Feature > ( selectedFeatures . values ( ) ) ; for ( Feature feature : clone ) { selectedFeatures . remove ( feature . getId ( ) ) ; handlerManager . fireEvent ( new FeatureDeselectedEvent ( feature ) ) ; } } | Clear the list of selected features . |
10,280 | public static String decode ( Style style ) { if ( style != null ) { if ( style instanceof ShapeStyle ) { return decode ( ( ShapeStyle ) style ) ; } else if ( style instanceof FontStyle ) { return decode ( ( FontStyle ) style ) ; } else if ( style instanceof PictureStyle ) { return decode ( ( PictureStyle ) style ) ; }... | Return the CSS equivalent of the Style object . |
10,281 | public static String getType ( GeometryIndex instance ) { switch ( instance . getType ( ) ) { case TYPE_GEOMETRY : return "geometry" ; case TYPE_VERTEX : return "vertex" ; case TYPE_EDGE : return "edge" ; default : return "unknown" ; } } | Get the type of sub - part this index points to . Can be a vertex edge or sub - geometry . |
10,282 | public void addCard ( KEY_TYPE key , Canvas card ) { if ( currentCard != null ) { currentCard . hide ( ) ; } addMember ( card ) ; currentCard = card ; cards . put ( key , card ) ; } | Add a card to the deck and associate it with the specified key . |
10,283 | public void showCard ( KEY_TYPE key ) { Canvas newCurrent = cards . get ( key ) ; if ( null != newCurrent ) { if ( newCurrent != currentCard && null != currentCard ) { currentCard . hide ( ) ; } currentCard = newCurrent ; currentCard . show ( ) ; } } | Show the card associated with the specified key . |
10,284 | public void addFeatures ( List < Feature > features ) { numFeatures += features . size ( ) ; for ( Feature feature : features ) { featureListGrid . addFeature ( feature ) ; } if ( sortFeatures ) { featureListGrid . sort ( sortFieldName , sortDirGWT ) ; } if ( exportCsvHandler instanceof ExportFeatureListToCsvHandler ) ... | Add features to grid . |
10,285 | public void setCriterion ( Criterion criterion ) { this . criterion = criterion ; if ( exportCsvHandler == null || exportCsvHandler instanceof ExportFeatureListToCsvHandler ) { this . exportCsvHandler = new ExportSearchToCsvHandler ( mapWidget . getMapModel ( ) , layer , criterion ) ; } else if ( exportCsvHandler insta... | Set the search criterion . |
10,286 | public boolean contains ( Paintable p ) { if ( children . contains ( p ) ) { return true ; } for ( Paintable t : children ) { if ( t instanceof Composite ) { if ( ( ( Composite ) t ) . contains ( p ) ) { return true ; } } } return false ; } | Recursively checks children to find p . |
10,287 | public void onLeafClick ( LeafClickEvent event ) { LayerTreeTreeNode layerTreeNode = ( LayerTreeTreeNode ) event . getLeaf ( ) ; if ( null != selectedLayerTreeNode && layerTreeNode . getLayer ( ) . getId ( ) . equals ( selectedLayerTreeNode . getLayer ( ) . getId ( ) ) ) { mapModel . selectLayer ( null ) ; } else { map... | When the user clicks on a leaf the header text of the tree table is changed to the selected leaf and the toolbar buttons are updated to represent the correct state of the buttons . |
10,288 | private ToolStrip buildToolstrip ( MapWidget mapWidget ) { toolStrip = new ToolStrip ( ) ; toolStrip . setWidth100 ( ) ; toolStrip . setPadding ( 3 ) ; ClientLayerTreeInfo layerTreeInfo = mapModel . getMapInfo ( ) . getLayerTree ( ) ; if ( layerTreeInfo != null ) { for ( ClientToolInfo tool : layerTreeInfo . getTools (... | Builds the toolbar |
10,289 | private void buildTree ( MapModel mapModel ) { treeGrid . setWidth100 ( ) ; treeGrid . setHeight100 ( ) ; treeGrid . setShowHeader ( false ) ; tree = new RefreshableTree ( ) ; final TreeNode nodeRoot = new TreeNode ( "ROOT" ) ; tree . setRoot ( nodeRoot ) ; ClientLayerTreeInfo layerTreeInfo = mapModel . getMapInfo ( ) ... | Builds up the tree showing the layers |
10,290 | private void updateButtonIconsAndStates ( Canvas [ ] toolStripMembers ) { for ( Canvas toolStripMember : toolStripMembers ) { if ( toolStripMember instanceof LayerTreeModalButton ) { ( ( LayerTreeModalButton ) toolStripMember ) . update ( ) ; } else if ( toolStripMember instanceof LayerTreeButton ) { ( ( LayerTreeButto... | Updates the icons and the state of the buttons in the toolbar based upon the currently selected layer |
10,291 | public void unhide ( Object group , String name ) { if ( isAttached ( ) ) { Element element = helper . getElement ( group , name ) ; if ( element != null ) { Dom . setStyleAttribute ( element , "visibility" , "inherit" ) ; } } } | Show the specified element in the specified group . If the element does not exist nothing will happen . |
10,292 | public void onLeafClick ( LeafClickEvent event ) { LayerTreeTreeNode layerTreeNode ; if ( event . getLeaf ( ) instanceof LayerTreeLegendItemNode ) { layerTreeNode = ( ( LayerTreeLegendItemNode ) event . getLeaf ( ) ) . parent ; treeGrid . deselectRecord ( event . getLeaf ( ) ) ; treeGrid . selectRecord ( layerTreeNode ... | When a legendItem is selected select the layer instead . |
10,293 | public void println ( String text , Color color ) { final Label label = new Label ( text , skin , "outputEntry" ) ; label . setColor ( color ) ; label . setWrap ( true ) ; addLabel ( label ) ; } | Add a single line to this buffer . The line may contain a \ n character and it will be honored but this is discouraged . |
10,294 | @ SuppressWarnings ( "unchecked" ) protected int hashFields ( int hash , Map < FieldDescriptor , Object > map ) { for ( Map . Entry < FieldDescriptor , Object > entry : map . entrySet ( ) ) { FieldDescriptor field = entry . getKey ( ) ; Object value = entry . getValue ( ) ; hash = ( 37 * hash ) + field . getNumber ( ) ... | Get a hash code for given fields and values using the given seed . |
10,295 | public static void initializeArg ( final RemoteProgram remoteProgram , final String [ ] arguments , final Launch < ? > launch ) throws OptionException , ParserException { int numberOfEquals = 0 ; for ( String argument : arguments ) { if ( argument . indexOf ( '=' ) > - 1 ) numberOfEquals ++ ; } if ( numberOfEquals != a... | Check the validity of arguments values coming from remote launching with regard to types . If not done the Quartz Exception thrown doesn t stop the launch and Program may be launched with invalid arguments values . |
10,296 | public void invoke ( Node root , Action result ) throws IOException { doInvoke ( 0 , root , root . isLink ( ) , new ArrayList < > ( includes ) , new ArrayList < > ( excludes ) , result ) ; } | Main methods of this class . |
10,297 | public String serialize ( Node node , boolean format ) { Result result ; StringWriter dest ; if ( node == null ) { throw new IllegalArgumentException ( ) ; } dest = new StringWriter ( ) ; result = new StreamResult ( dest ) ; try { serialize ( node , result , format ) ; } catch ( IOException e ) { throw new IllegalState... | does not genereate encoding headers |
10,298 | public IContextMapping < INode > filter ( IContextMapping < INode > mapping ) throws MappingFilterException { if ( 0 < mapping . size ( ) ) { IContext sourceContext = mapping . getSourceContext ( ) ; IContext targetContext = mapping . getTargetContext ( ) ; sourceIndex = new ArrayList < Integer > ( ) ; targetIndex = ne... | Sorts the siblings in the source and target tree defined in the constructor using the given mapping . |
10,299 | private void filterMappingsOfChildren ( INode sourceParent , INode targetParent , char semanticRelation ) { List < INode > source = new ArrayList < INode > ( sourceParent . getChildrenList ( ) ) ; List < INode > target = new ArrayList < INode > ( targetParent . getChildrenList ( ) ) ; sourceIndex . add ( sourceParent .... | Sorts the children of the given nodes . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.