idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
6,100 | private static int computeFieldSize ( AttributeValue value ) throws DBaseFileException , AttributeException { final DBaseFieldType dbftype = DBaseFieldType . fromAttributeType ( value . getType ( ) ) ; return dbftype . getFieldSize ( value . getString ( ) ) ; } | Replies the size of the DBase field which must contains the value of the given attribute value . | 66 | 20 |
6,101 | private static int computeDecimalSize ( AttributeValue value ) throws DBaseFileException , AttributeException { final DBaseFieldType dbftype = DBaseFieldType . fromAttributeType ( value . getType ( ) ) ; return dbftype . getDecimalPointPosition ( value . getString ( ) ) ; } | Replies the decimal size of the DBase field which must contains the value of the given attribute value . | 69 | 21 |
6,102 | @ Pure public static boolean isSupportedType ( DBaseFieldType type ) { return ( type != DBaseFieldType . BINARY ) && ( type != DBaseFieldType . GENERAL ) && ( type != DBaseFieldType . MEMORY ) && ( type != DBaseFieldType . PICTURE ) && ( type != DBaseFieldType . VARIABLE ) ; } | Replies if the given dBASE type is supported by this writer . | 81 | 14 |
6,103 | @ SuppressWarnings ( "checkstyle:magicnumber" ) private List < DBaseFileField > extractColumns ( List < ? extends AttributeProvider > providers ) throws DBaseFileException , AttributeException { final Map < String , DBaseFileField > attributeColumns = new TreeMap <> ( ) ; DBaseFileField oldField ; String name ; String kname ; int fieldSize ; int decimalSize ; final Set < String > skippedColumns = new TreeSet <> ( ) ; for ( final AttributeProvider provider : providers ) { for ( final Attribute attr : provider . attributes ( ) ) { final DBaseFieldType dbftype = DBaseFieldType . fromAttributeType ( attr . getType ( ) ) ; // The following types are not yet supported if ( isSupportedType ( dbftype ) ) { name = attr . getName ( ) ; kname = name . toLowerCase ( ) ; oldField = attributeColumns . get ( kname ) ; // compute the sizes fieldSize = computeFieldSize ( attr ) ; decimalSize = computeDecimalSize ( attr ) ; if ( oldField == null ) { oldField = new DBaseFileField ( name , dbftype , fieldSize , decimalSize ) ; attributeColumns . put ( kname , oldField ) ; } else { oldField . updateSizes ( fieldSize , decimalSize ) ; } } else { skippedColumns . add ( attr . getName ( ) . toUpperCase ( ) ) ; } } // Be sure that the memory was not fully filled by the saving process provider . freeMemory ( ) ; } //Max of field allowed : 128 if ( attributeColumns . size ( ) > 128 ) { throw new TooManyDBaseColumnException ( attributeColumns . size ( ) , 128 ) ; } final List < DBaseFileField > dbColumns = new ArrayList <> ( ) ; dbColumns . addAll ( attributeColumns . values ( ) ) ; attributeColumns . clear ( ) ; for ( int idx = 0 ; idx < dbColumns . size ( ) ; ++ idx ) { dbColumns . get ( idx ) . setColumnIndex ( idx ) ; } if ( ! skippedColumns . isEmpty ( ) ) { columnsSkipped ( skippedColumns ) ; } return dbColumns ; } | Extract the attribute s columns from the attributes providers . | 509 | 11 |
6,104 | public void writeHeader ( List < ? extends AttributeProvider > providers ) throws IOException , AttributeException { if ( this . columns == null ) { this . columns = extractColumns ( providers ) ; writeDescriptionHeader ( providers . size ( ) ) ; writeColumns ( ) ; } } | Write the header of the dbf file . | 62 | 9 |
6,105 | @ SuppressWarnings ( { "checkstyle:cyclomaticcomplexity" , "checkstyle:magicnumber" } ) public void writeRecord ( AttributeProvider element ) throws IOException , AttributeException { if ( this . columns == null ) { throw new MustCallWriteHeaderFunctionException ( ) ; } //Field deleted flag (value : 2Ah (*) => Record is deleted, 20h (blank) => Record is valid) this . stream . writeByte ( 0x20 ) ; for ( final DBaseFileField field : this . columns ) { // Get attribute final DBaseFieldType dbftype = field . getType ( ) ; final String fieldName = field . getName ( ) ; AttributeValue attr = element != null ? element . getAttribute ( fieldName ) : null ; if ( attr == null ) { attr = new AttributeValueImpl ( dbftype . toAttributeType ( ) ) ; attr . setToDefault ( ) ; } else { if ( attr . isAssigned ( ) ) { attr = new AttributeValueImpl ( attr ) ; attr . cast ( dbftype . toAttributeType ( ) ) ; } else { attr = new AttributeValueImpl ( attr ) ; attr . setToDefaultIfUninitialized ( ) ; } } // Write value switch ( dbftype ) { case BOOLEAN : writeDBFBoolean ( attr . getBoolean ( ) ) ; break ; case DATE : writeDBFDate ( attr . getDate ( ) ) ; break ; case STRING : writeDBFString ( attr . getString ( ) , field . getLength ( ) , ( byte ) ' ' ) ; break ; case INTEGER_2BYTES : writeDBFInteger ( ( short ) attr . getInteger ( ) ) ; break ; case INTEGER_4BYTES : writeDBFLong ( ( int ) attr . getInteger ( ) ) ; break ; case DOUBLE : writeDBFDouble ( attr . getReal ( ) ) ; break ; case FLOATING_NUMBER : case NUMBER : if ( attr . getType ( ) == AttributeType . REAL ) { writeDBFNumber ( attr . getReal ( ) , field . getLength ( ) , field . getDecimalPointPosition ( ) ) ; } else { writeDBFNumber ( attr . getInteger ( ) , field . getLength ( ) , field . getDecimalPointPosition ( ) ) ; } break ; case BINARY : case GENERAL : case MEMORY : case PICTURE : case VARIABLE : // not yet supported writeDBFString ( ( String ) null , 10 , ( byte ) 0 ) ; break ; default : throw new IllegalStateException ( ) ; } } // Be sure that the memory was not fully filled by the saving process if ( element != null ) { element . freeMemory ( ) ; } } | Write a record for attribute provider . | 633 | 7 |
6,106 | public void write ( AttributeProvider ... providers ) throws IOException , AttributeException { writeHeader ( providers ) ; for ( final AttributeProvider provider : providers ) { writeRecord ( provider ) ; } close ( ) ; } | Write the DBase file . | 47 | 6 |
6,107 | @ Override @ SuppressWarnings ( "checkstyle:magicnumber" ) public void close ( ) throws IOException { if ( this . stream != null ) { //End of file (1Ah) this . stream . write ( 0x1A ) ; this . stream . close ( ) ; this . stream = null ; } if ( this . columns != null ) { this . columns . clear ( ) ; this . columns = null ; } } | Close the dBASE file . | 96 | 6 |
6,108 | @ Pure public final N getChildAt ( BinaryTreeZone index ) { switch ( index ) { case LEFT : return this . left ; case RIGHT : return this . right ; default : throw new IndexOutOfBoundsException ( ) ; } } | Replies the child node at the specified position . | 52 | 10 |
6,109 | public boolean setRightChild ( N newChild ) { final N oldChild = this . right ; if ( oldChild == newChild ) { return false ; } if ( oldChild != null ) { oldChild . setParentNodeReference ( null , true ) ; -- this . notNullChildCount ; firePropertyChildRemoved ( 1 , oldChild ) ; } if ( newChild != null ) { final N oldParent = newChild . getParentNode ( ) ; if ( oldParent != this ) { newChild . removeFromParent ( ) ; } } this . right = newChild ; if ( newChild != null ) { newChild . setParentNodeReference ( toN ( ) , true ) ; ++ this . notNullChildCount ; firePropertyChildAdded ( 1 , newChild ) ; } return true ; } | Set the right child of this node . | 170 | 8 |
6,110 | public final boolean setChildAt ( BinaryTreeZone zone , N newChild ) { switch ( zone ) { case LEFT : return setLeftChild ( newChild ) ; case RIGHT : return setRightChild ( newChild ) ; default : throw new IndexOutOfBoundsException ( ) ; } } | Set the child for the specified zone . | 62 | 8 |
6,111 | public void add ( final String key , final String value ) { data . setProperty ( key , value ) ; fireTableDataChanged ( ) ; } | Adds the row from the given key and value . | 31 | 10 |
6,112 | @ Override protected HashMap readFile ( HashMap brMap ) throws IOException { HashMap ret = new HashMap ( ) ; ArrayList < HashMap > files = readDailyData ( brMap , new HashMap ( ) ) ; // compressData(files); ret . put ( "weathers" , files ) ; return ret ; } | DSSAT Weather Data input method for only inputing weather file | 72 | 13 |
6,113 | @ Pure public void getTranslationVector ( Tuple2D < ? > translation ) { assert translation != null : AssertMessages . notNullParameter ( ) ; translation . set ( this . m02 , this . m12 ) ; } | Replies the translation . | 50 | 5 |
6,114 | @ SuppressWarnings ( "checkstyle:magicnumber" ) protected void getScaleRotate2x2 ( double [ ] scales , double [ ] rots ) { final double [ ] tmp = new double [ 9 ] ; tmp [ 0 ] = this . m00 ; tmp [ 1 ] = this . m01 ; tmp [ 2 ] = 0 ; tmp [ 3 ] = this . m10 ; tmp [ 4 ] = this . m11 ; tmp [ 5 ] = 0 ; tmp [ 6 ] = 0 ; tmp [ 7 ] = 0 ; tmp [ 8 ] = 0 ; computeSVD ( tmp , scales , rots ) ; } | Perform SVD on the 2x2 matrix containing the rotation and scaling factors . | 137 | 17 |
6,115 | @ Pure @ SuppressWarnings ( "checkstyle:magicnumber" ) public double getRotation ( ) { final double [ ] tmpScale = new double [ 3 ] ; final double [ ] tmpRot = new double [ 9 ] ; getScaleRotate2x2 ( tmpScale , tmpRot ) ; if ( Math . signum ( tmpRot [ 0 ] ) != Math . signum ( tmpRot [ 4 ] ) ) { // Sinuses are on the top-left to bottom-right diagonal // -s c 0 // c s 0 // 0 0 1 return Math . atan2 ( tmpRot [ 4 ] , tmpRot [ 3 ] ) ; } // Sinuses are on the top-right to bottom-left diagonal // c -s 0 // s c 0 // 0 0 1 return Math . atan2 ( tmpRot [ 3 ] , tmpRot [ 0 ] ) ; } | Performs an SVD normalization of this matrix to calculate and return the rotation angle . | 189 | 18 |
6,116 | @ SuppressWarnings ( "checkstyle:magicnumber" ) public void setRotation ( double angle ) { final double [ ] tmpScale = new double [ 3 ] ; final double [ ] tmpRot = new double [ 9 ] ; getScaleRotate2x2 ( tmpScale , tmpRot ) ; final double cos = Math . cos ( angle ) ; final double sin = Math . sin ( angle ) ; // R * S this . m00 = tmpScale [ 0 ] * cos ; this . m01 = tmpScale [ 1 ] * - sin ; this . m10 = tmpScale [ 0 ] * sin ; this . m11 = tmpScale [ 1 ] * cos ; // S * R // this.m00 = tmp_scale[0] * cos; // this.m01 = tmp_scale[0] * -sin; // this.m10 = tmp_scale[1] * sin; // this.m11 = tmp_scale[1] * cos; } | Change the rotation of this matrix . Performs an SVD normalization of this matrix for determining and preserving the scaling . | 211 | 24 |
6,117 | @ Pure @ SuppressWarnings ( "checkstyle:magicnumber" ) public double getScale ( ) { final double [ ] tmpScale = new double [ 3 ] ; final double [ ] tmpRot = new double [ 9 ] ; getScaleRotate2x2 ( tmpScale , tmpRot ) ; return MathUtil . max ( tmpScale ) ; } | Performs an SVD normalization of this matrix to calculate and return the uniform scale factor . If the matrix has non - uniform scale factors the largest of the x y scale factors will be returned . | 77 | 40 |
6,118 | @ Pure @ SuppressWarnings ( "checkstyle:magicnumber" ) public void getScaleVector ( Tuple2D < ? > scale ) { assert scale != null : AssertMessages . notNullParameter ( ) ; final double [ ] tmpScale = new double [ 3 ] ; final double [ ] tmpRot = new double [ 9 ] ; getScaleRotate2x2 ( tmpScale , tmpRot ) ; scale . set ( tmpScale [ 0 ] , tmpScale [ 1 ] ) ; } | Performs an SVD normalization of this matrix to calculate and return the scale factors for X and Y axess . | 108 | 24 |
6,119 | @ SuppressWarnings ( "checkstyle:magicnumber" ) public void setScale ( double scaleX , double scaleY ) { final double [ ] tmpScale = new double [ 3 ] ; final double [ ] tmpRot = new double [ 9 ] ; getScaleRotate2x2 ( tmpScale , tmpRot ) ; this . m00 = tmpRot [ 0 ] * scaleX ; this . m01 = tmpRot [ 1 ] * scaleY ; this . m10 = tmpRot [ 3 ] * scaleX ; this . m11 = tmpRot [ 4 ] * scaleY ; } | Change the scale of this matrix . Performs an SVD normalization of this matrix for determining and preserving the rotation . | 127 | 24 |
6,120 | public void setScale ( Tuple2D < ? > tuple ) { assert tuple != null : AssertMessages . notNullParameter ( ) ; setScale ( tuple . getX ( ) , tuple . getY ( ) ) ; } | Set the scale . | 50 | 4 |
6,121 | public void makeRotationMatrix ( double angle ) { final double sinAngle = Math . sin ( angle ) ; final double cosAngle = Math . cos ( angle ) ; this . m00 = cosAngle ; this . m01 = - sinAngle ; this . m02 = 0. ; this . m11 = cosAngle ; this . m10 = sinAngle ; this . m12 = 0. ; this . m20 = 0. ; this . m21 = 0. ; this . m22 = 1. ; } | Sets the value of this matrix to a counter clockwise rotation about the x axis and no translation | 115 | 20 |
6,122 | public void makeTranslationMatrix ( double dx , double dy ) { this . m00 = 1. ; this . m01 = 0. ; this . m02 = dx ; this . m10 = 0. ; this . m11 = 1. ; this . m12 = dy ; this . m20 = 0. ; this . m21 = 0. ; this . m22 = 1. ; } | Sets the value of this matrix to the given translation without rotation . | 84 | 14 |
6,123 | public void makeScaleMatrix ( double scaleX , double scaleY ) { this . m00 = scaleX ; this . m01 = 0. ; this . m02 = 0. ; this . m10 = 0. ; this . m11 = scaleY ; this . m12 = 0. ; this . m20 = 0. ; this . m21 = 0. ; this . m22 = 1. ; } | Sets the value of this matrix to the given scaling without rotation . | 88 | 14 |
6,124 | public void transform ( Tuple2D < ? > tuple , Tuple2D < ? > result ) { assert tuple != null : AssertMessages . notNullParameter ( 0 ) ; assert result != null : AssertMessages . notNullParameter ( 1 ) ; result . set ( this . m00 * tuple . getX ( ) + this . m01 * tuple . getY ( ) + this . m02 , this . m10 * tuple . getX ( ) + this . m11 * tuple . getY ( ) + this . m12 ) ; } | Multiply this matrix by the tuple t and and place the result into the tuple result . | 121 | 19 |
6,125 | protected void initializeButton ( final Button button , final Color foreground , final Color background ) { button . setForeground ( foreground ) ; button . setBackground ( background ) ; } | Initialize a button . | 36 | 5 |
6,126 | private void initializeButtons ( ) { initializeButton ( button1 = new Button ( "1" ) , Color . black , Color . lightGray ) ; initializeButton ( button2 = new Button ( "2" ) , Color . black , Color . lightGray ) ; initializeButton ( button3 = new Button ( "3" ) , Color . black , Color . lightGray ) ; initializeButton ( button4 = new Button ( "4" ) , Color . black , Color . lightGray ) ; initializeButton ( button5 = new Button ( "5" ) , Color . black , Color . lightGray ) ; initializeButton ( button6 = new Button ( "6" ) , Color . black , Color . lightGray ) ; initializeButton ( button7 = new Button ( "7" ) , Color . black , Color . lightGray ) ; initializeButton ( button8 = new Button ( "8" ) , Color . black , Color . lightGray ) ; initializeButton ( button9 = new Button ( "9" ) , Color . black , Color . lightGray ) ; initializeButton ( button0 = new Button ( "0" ) , Color . black , Color . lightGray ) ; initializeButton ( buttonCancel = new Button ( "A" ) , Color . black , Color . lightGray ) ; initializeButton ( buttonTable = new Button ( "T" ) , Color . black , Color . lightGray ) ; initializeButton ( buttonEnter = new Button ( "E" ) , Color . black , Color . lightGray ) ; initializeButton ( buttonMinus = new Button ( "-" ) , Color . black , Color . lightGray ) ; initializeButton ( buttonPlus = new Button ( "+" ) , Color . black , Color . lightGray ) ; initializeButton ( buttonStorno = new Button ( "ST" ) , Color . black , Color . lightGray ) ; } | Initialize the buttons . | 394 | 5 |
6,127 | public void connectBeginToBegin ( SGraphSegment segment ) { if ( segment . getGraph ( ) != getGraph ( ) ) { throw new IllegalArgumentException ( ) ; } final SGraphPoint point = new SGraphPoint ( getGraph ( ) ) ; setBegin ( point ) ; segment . setBegin ( point ) ; final SGraph g = getGraph ( ) ; assert g != null ; g . updatePointCount ( - 1 ) ; } | Connect the begin point of this segment to the begin point of the given segment . This function change the connection points of the two segments . | 96 | 27 |
6,128 | public void connectBeginToEnd ( SGraphSegment segment ) { if ( segment . getGraph ( ) != getGraph ( ) ) { throw new IllegalArgumentException ( ) ; } final SGraphPoint point = new SGraphPoint ( getGraph ( ) ) ; setBegin ( point ) ; segment . setEnd ( point ) ; final SGraph g = getGraph ( ) ; assert g != null ; g . updatePointCount ( - 1 ) ; } | Connect the begin point of this segment to the end point of the given segment . This function change the connection points of the two segments . | 96 | 27 |
6,129 | public void connectEndToEnd ( SGraphSegment segment ) { if ( segment . getGraph ( ) != getGraph ( ) ) { throw new IllegalArgumentException ( ) ; } final SGraphPoint point = new SGraphPoint ( getGraph ( ) ) ; setEnd ( point ) ; segment . setEnd ( point ) ; final SGraph g = getGraph ( ) ; assert g != null ; g . updatePointCount ( - 1 ) ; } | Connect the end point of this segment to the end point of the given segment . This function change the connection points of the two segments . | 96 | 27 |
6,130 | public void disconnectBegin ( ) { if ( this . startPoint != null ) { this . startPoint . remove ( this ) ; } this . startPoint = new SGraphPoint ( getGraph ( ) ) ; this . startPoint . add ( this ) ; } | Disconnect the begin point of this segment . | 55 | 9 |
6,131 | public void disconnectEnd ( ) { if ( this . endPoint != null ) { this . endPoint . remove ( this ) ; } this . endPoint = new SGraphPoint ( getGraph ( ) ) ; this . endPoint . add ( this ) ; } | Disconnect the end point of this segment . | 55 | 9 |
6,132 | public boolean addUserData ( Object userData ) { if ( this . userData == null ) { this . userData = new ArrayList <> ( ) ; } return this . userData . add ( userData ) ; } | Add a user data in the data associated to this point . | 48 | 12 |
6,133 | @ Pure public Object getUserDataAt ( int index ) { if ( this . userData == null ) { throw new IndexOutOfBoundsException ( ) ; } return this . userData . get ( index ) ; } | Replies the user data at the given index . | 47 | 10 |
6,134 | public void setUserDataAt ( int index , Object data ) { if ( this . userData == null ) { throw new IndexOutOfBoundsException ( ) ; } this . userData . set ( index , data ) ; } | Set the user data at the given index . | 49 | 9 |
6,135 | @ Pure public Collection < Object > getAllUserData ( ) { if ( this . userData == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableCollection ( this . userData ) ; } | Replies all the user data . | 48 | 7 |
6,136 | public static void displayUsage ( String cmdLineSyntax , Options options ) { HelpFormatter helpFormatter = new HelpFormatter ( ) ; helpFormatter . printHelp ( cmdLineSyntax , options ) ; } | Displays usage . | 46 | 4 |
6,137 | private Graphics2D initGraphics2D ( final Graphics g ) { Graphics2D g2 ; g2 = ( Graphics2D ) g ; g2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; g2 . setRenderingHint ( RenderingHints . KEY_RENDERING , RenderingHints . VALUE_RENDER_QUALITY ) ; g2 . setColor ( this . color ) ; return g2 ; } | Inits the graphics2D object . | 122 | 8 |
6,138 | @ Override public T decode ( final String s ) { checkNotNull ( s ) ; try { return Enum . valueOf ( type , s ) ; } catch ( final IllegalArgumentException ignored ) { } try { return Enum . valueOf ( type , s . toUpperCase ( ) ) ; } catch ( final IllegalArgumentException ignored ) { } try { return Enum . valueOf ( type , s . toLowerCase ( ) ) ; } catch ( final IllegalArgumentException ignored ) { } throw new ConversionException ( "Unable to instantiate a " + type + " from value " + s + ". Valid values: " + Joiner . on ( ", " ) . join ( EnumSet . allOf ( type ) ) ) ; } | Converts a string to a value of the enum type . If the string cannot be converted to an enum value as - is conversion is attempted on the string in uppercase and then in lowercase as a fallback . | 163 | 45 |
6,139 | @ Pure protected int compareConnections ( PT p1 , PT p2 ) { assert p1 != null && p2 != null ; return p1 . hashCode ( ) - p2 . hashCode ( ) ; } | Compare the two given entry points . | 46 | 7 |
6,140 | public void addAllLeftRowsToRightTable ( ) { rightTable . getGenericTableModel ( ) . addList ( leftTable . getGenericTableModel ( ) . getData ( ) ) ; leftTable . getGenericTableModel ( ) . clear ( ) ; } | Adds the all left rows to right table . | 57 | 9 |
6,141 | public void addAllRightRowsToLeftTable ( ) { leftTable . getGenericTableModel ( ) . addList ( rightTable . getGenericTableModel ( ) . getData ( ) ) ; rightTable . getGenericTableModel ( ) . clear ( ) ; } | Adds the all right rows to left table . | 57 | 9 |
6,142 | public void shuffleSelectedLeftRowsToRightTable ( ) { final int [ ] selectedRows = leftTable . getSelectedRows ( ) ; final int lastIndex = selectedRows . length - 1 ; for ( int i = lastIndex ; - 1 < i ; i -- ) { final int selectedRow = selectedRows [ i ] ; final T row = leftTable . getGenericTableModel ( ) . removeAt ( selectedRow ) ; rightTable . getGenericTableModel ( ) . add ( row ) ; } } | Shuffle selected left rows to right table . | 113 | 9 |
6,143 | public static List < String > loadOptions ( String optionFileName ) { List < String > args = new ArrayList < String > ( ) ; File optionFile = new File ( optionFileName ) ; StringWriter stringWriter = new StringWriter ( ) ; try { InputStream inputStream = new FileInputStream ( optionFile ) ; IOUtils . copy ( inputStream , stringWriter ) ; } catch ( FileNotFoundException e ) { System . err . println ( "Error reading options file: " + e . getMessage ( ) ) ; System . exit ( 1 ) ; } catch ( IOException e ) { System . err . println ( "Error reading options file: " + e . getMessage ( ) ) ; System . exit ( 1 ) ; } String string = stringWriter . toString ( ) ; StringTokenizer stringTokenizer = new StringTokenizer ( string ) ; while ( stringTokenizer . hasMoreTokens ( ) ) { args . add ( stringTokenizer . nextToken ( ) ) ; } return args ; } | Load options from a file | 218 | 5 |
6,144 | @ Pure public static boolean isShapeFile ( URL file ) { return FileType . isContentType ( file , MimeName . MIME_SHAPE_FILE . getMimeConstant ( ) ) ; } | Replies if the specified file content is a ESRI shape file . | 45 | 14 |
6,145 | @ SuppressWarnings ( "static-method" ) @ Provides @ Singleton public HelpGenerator provideHelpGenerator ( ApplicationMetadata metadata , Injector injector , Terminal terminal ) { int maxColumns = terminal . getColumns ( ) ; if ( maxColumns < TTY_MIN_COLUMNS ) { maxColumns = TTY_DEFAULT_COLUMNS ; } String argumentSynopsis ; try { argumentSynopsis = injector . getInstance ( Key . get ( String . class , ApplicationArgumentSynopsis . class ) ) ; } catch ( Exception exception ) { argumentSynopsis = null ; } String detailedDescription ; try { detailedDescription = injector . getInstance ( Key . get ( String . class , ApplicationDetailedDescription . class ) ) ; } catch ( Exception exception ) { detailedDescription = null ; } return new SynopsisHelpGenerator ( metadata , argumentSynopsis , detailedDescription , maxColumns ) ; } | Provide the help generator with synopsis . | 197 | 8 |
6,146 | public ZoomableGraphicsContext getDocumentGraphicsContext2D ( ) { if ( this . documentGraphicsContext == null ) { final CenteringTransform transform = new CenteringTransform ( invertedAxisXProperty ( ) , invertedAxisYProperty ( ) , viewportBoundsProperty ( ) ) ; this . documentGraphicsContext = new ZoomableGraphicsContext ( getGraphicsContext2D ( ) , scaleValueProperty ( ) , documentBoundsProperty ( ) , viewportBoundsProperty ( ) , widthProperty ( ) , heightProperty ( ) , drawableElementBudgetProperty ( ) , transform ) ; } return this . documentGraphicsContext ; } | Replies the document graphics context . | 133 | 7 |
6,147 | protected void fireDrawingStart ( ) { final ListenerCollection < EventListener > list = this . listeners ; if ( list != null ) { for ( final DrawingListener listener : list . getListeners ( DrawingListener . class ) ) { listener . onDrawingStart ( ) ; } } } | Notifies listeners on drawing start . | 62 | 7 |
6,148 | protected void fireDrawingEnd ( ) { final ListenerCollection < EventListener > list = this . listeners ; if ( list != null ) { for ( final DrawingListener listener : list . getListeners ( DrawingListener . class ) ) { listener . onDrawingEnd ( ) ; } } } | Notifies listeners on drawing finishing . | 62 | 7 |
6,149 | @ Pure public static BusLayerDrawerType getPreferredLineDrawAlgorithm ( ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { final String algo = prefs . get ( "DRAWING_ALGORITHM" , null ) ; //$NON-NLS-1$ if ( algo != null && algo . length ( ) > 0 ) { try { return BusLayerDrawerType . valueOf ( algo ) ; } catch ( Throwable exception ) { // } } } return BusLayerDrawerType . OVERLAP ; } | Replies if the bus network should be drawn with the algorithm . | 139 | 13 |
6,150 | public static void setPreferredLineDrawingAlgorithm ( BusLayerDrawerType algorithm ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { if ( algorithm == null ) { prefs . remove ( "DRAWING_ALGORITHM" ) ; //$NON-NLS-1$ } else { prefs . put ( "DRAWING_ALGORITHM" , algorithm . name ( ) ) ; //$NON-NLS-1$ } } } | Set if the bus network should be drawn with the algorithm . | 123 | 12 |
6,151 | @ Pure public static int getSelectionColor ( ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { final String str = prefs . get ( "SELECTION_COLOR" , null ) ; //$NON-NLS-1$ if ( str != null ) { try { return Integer . valueOf ( str ) ; } catch ( Throwable exception ) { // } } } return DEFAULT_SELECTION_COLOR ; } | Replies if the preferred color for bus stops selection . | 109 | 11 |
6,152 | public static void setSelectionColor ( Integer color ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { if ( color == null || color == DEFAULT_SELECTION_COLOR ) { prefs . remove ( "SELECTION_COLOR" ) ; //$NON-NLS-1$ } else { prefs . put ( "SELECTION_COLOR" , color . toString ( ) ) ; //$NON-NLS-1$ } try { prefs . flush ( ) ; } catch ( BackingStoreException exception ) { // } } } | Set the default color selection . | 137 | 6 |
6,153 | @ Pure public static boolean isBusStopDrawable ( ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { return prefs . getBoolean ( "DRAW_BUS_STOPS" , DEFAULT_BUS_STOP_DRAWING ) ; //$NON-NLS-1$ } return DEFAULT_BUS_STOP_DRAWING ; } | Replies if the bus stops should be drawn or not . | 97 | 12 |
6,154 | @ Pure public static boolean isBusStopNamesDrawable ( ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { return prefs . getBoolean ( "DRAW_BUS_STOPS_NAMES" , DEFAULT_BUS_STOP_NAMES_DRAWING ) ; //$NON-NLS-1$ } return DEFAULT_BUS_STOP_NAMES_DRAWING ; } | Replies if the bus stops names should be drawn or not . | 107 | 13 |
6,155 | public static void setBusStopNamesDrawable ( Boolean isNamesDrawable ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { if ( isNamesDrawable == null ) { prefs . remove ( "DRAW_BUS_STOPS_NAMES" ) ; //$NON-NLS-1$ } else { prefs . putBoolean ( "DRAW_BUS_STOPS_NAMES" , isNamesDrawable . booleanValue ( ) ) ; //$NON-NLS-1$ } try { prefs . sync ( ) ; } catch ( BackingStoreException exception ) { // } } } | Set if the bus stops should be drawn or not . | 152 | 11 |
6,156 | @ Pure public static boolean isBusStopNoHaltBindingDrawable ( ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { return prefs . getBoolean ( "DRAW_NO_BUS_HALT_BIND" , DEFAULT_NO_BUS_HALT_BIND ) ; //$NON-NLS-1$ } return DEFAULT_NO_BUS_HALT_BIND ; } | Replies if the bus stops with no binding to bus halt should be drawn or not . | 109 | 18 |
6,157 | public static void setBusStopNoHaltBindingDrawable ( Boolean isDrawable ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { if ( isDrawable == null ) { prefs . remove ( "DRAW_NO_BUS_HALT_BIND" ) ; //$NON-NLS-1$ } else { prefs . putBoolean ( "DRAW_NO_BUS_HALT_BIND" , isDrawable . booleanValue ( ) ) ; //$NON-NLS-1$ } try { prefs . sync ( ) ; } catch ( BackingStoreException exception ) { // } } } | Set if the bus stops stops with no binding to bus halt should be drawn or not . | 157 | 18 |
6,158 | @ Pure public static boolean isBusStopNoHaltBindingNamesDrawable ( ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { return prefs . getBoolean ( "DRAW_NO_BUS_HALT_BIND_NAMES" , DEFAULT_NO_BUS_HALT_BIND_NAMES ) ; //$NON-NLS-1$ } return DEFAULT_NO_BUS_HALT_BIND_NAMES ; } | Replies if the bus stops with no binding to bus halt should have their names drawn or not . | 119 | 20 |
6,159 | @ Pure public static boolean isAttributeExhibitable ( ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { return prefs . getBoolean ( "EXHIBIT_ATTRIBUTES" , DEFAULT_ATTRIBUTE_EXHIBITION ) ; //$NON-NLS-1$ } return DEFAULT_ATTRIBUTE_EXHIBITION ; } | Replies if the attributes of the bus network elements should be exhibited by the layers that are displaying them . For example a BusLineLayer may exhibit the BusLine attributes . | 102 | 34 |
6,160 | public static void setAttributeExhibitable ( Boolean isExhibit ) { final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { if ( isExhibit == null ) { prefs . remove ( "EXHIBIT_ATTRIBUTES" ) ; //$NON-NLS-1$ } else { prefs . putBoolean ( "EXHIBIT_ATTRIBUTES" , isExhibit . booleanValue ( ) ) ; //$NON-NLS-1$ } try { prefs . sync ( ) ; } catch ( BackingStoreException exception ) { // } } } | Set if the attributes of the bus network elements should be exhibited by the layers that are displaying them . For example a BusLineLayer may exhibit the BusLine attributes . | 148 | 33 |
6,161 | public JsonLdModule configure ( ConfigParam param , String value ) { Objects . requireNonNull ( param ) ; configuration . set ( param , value ) ; return this ; } | Configure this module with additional parameters . | 38 | 8 |
6,162 | public boolean setFirstChild ( N newChild ) { final N oldChild = this . nNorthWest ; if ( oldChild == newChild ) { return false ; } if ( oldChild != null ) { oldChild . setParentNodeReference ( null , true ) ; -- this . notNullChildCount ; firePropertyChildRemoved ( 0 , oldChild ) ; } if ( newChild != null ) { final N oldParent = newChild . getParentNode ( ) ; if ( oldParent != this ) { newChild . removeFromParent ( ) ; } } this . nNorthWest = newChild ; if ( newChild != null ) { newChild . setParentNodeReference ( toN ( ) , true ) ; ++ this . notNullChildCount ; firePropertyChildAdded ( 0 , newChild ) ; } return true ; } | Set the first child of this node . | 174 | 8 |
6,163 | public boolean setSecondChild ( N newChild ) { final N oldChild = this . nNorthEast ; if ( oldChild == newChild ) { return false ; } if ( oldChild != null ) { oldChild . setParentNodeReference ( null , true ) ; -- this . notNullChildCount ; firePropertyChildRemoved ( 1 , oldChild ) ; } if ( newChild != null ) { final N oldParent = newChild . getParentNode ( ) ; if ( oldParent != this ) { newChild . removeFromParent ( ) ; } } this . nNorthEast = newChild ; if ( newChild != null ) { newChild . setParentNodeReference ( toN ( ) , true ) ; ++ this . notNullChildCount ; firePropertyChildAdded ( 1 , newChild ) ; } return true ; } | Set the second child of this node . | 174 | 8 |
6,164 | public boolean setThirdChild ( N newChild ) { final N oldChild = this . nSouthWest ; if ( oldChild == newChild ) { return false ; } if ( oldChild != null ) { oldChild . setParentNodeReference ( null , true ) ; -- this . notNullChildCount ; firePropertyChildRemoved ( 2 , oldChild ) ; } if ( newChild != null ) { final N oldParent = newChild . getParentNode ( ) ; if ( oldParent != this ) { newChild . removeFromParent ( ) ; } } this . nSouthWest = newChild ; if ( newChild != null ) { newChild . setParentNodeReference ( toN ( ) , true ) ; ++ this . notNullChildCount ; firePropertyChildAdded ( 2 , newChild ) ; } return true ; } | Set the third child of this node . | 174 | 8 |
6,165 | public boolean setFourthChild ( N newChild ) { final N oldChild = this . nSouthEast ; if ( oldChild == newChild ) { return false ; } if ( oldChild != null ) { oldChild . setParentNodeReference ( null , true ) ; -- this . notNullChildCount ; firePropertyChildRemoved ( 3 , oldChild ) ; } if ( newChild != null ) { final N oldParent = newChild . getParentNode ( ) ; if ( oldParent != this ) { newChild . removeFromParent ( ) ; } } this . nSouthEast = newChild ; if ( newChild != null ) { newChild . setParentNodeReference ( toN ( ) , true ) ; ++ this . notNullChildCount ; firePropertyChildAdded ( 3 , newChild ) ; } return true ; } | Set the Fourth child of this node . | 174 | 8 |
6,166 | public boolean setChildAt ( QuadTreeZone zone , N newChild ) { switch ( zone ) { case NORTH_WEST : return setFirstChild ( newChild ) ; case NORTH_EAST : return setSecondChild ( newChild ) ; case SOUTH_WEST : return setThirdChild ( newChild ) ; case SOUTH_EAST : return setFourthChild ( newChild ) ; default : } return false ; } | Set the child at the specified zone . | 92 | 8 |
6,167 | @ SuppressWarnings ( { "checkstyle:magicnumber" , "checkstyle:cyclomaticcomplexity" } ) public boolean remove ( Point3D < ? , ? > point ) { if ( this . types != null && ! this . types . isEmpty ( ) && this . coords != null && ! this . coords . isEmpty ( ) ) { for ( int i = 0 , j = 0 ; i < this . coords . size ( ) && j < this . types . size ( ) ; j ++ ) { final Point3dfx currentPoint = this . coords . get ( i ) ; switch ( this . types . get ( j ) ) { case MOVE_TO : //$FALL-THROUGH$ case LINE_TO : if ( point . equals ( currentPoint ) ) { this . coords . remove ( i ) ; this . types . remove ( j ) ; return true ; } i ++ ; break ; case CURVE_TO : final Point3dfx p2 = this . coords . get ( i + 1 ) ; final Point3dfx p3 = this . coords . get ( i + 2 ) ; if ( ( point . equals ( currentPoint ) ) || ( point . equals ( p2 ) ) || ( point . equals ( p3 ) ) ) { this . coords . remove ( i , i + 3 ) ; this . types . remove ( j ) ; return true ; } i += 3 ; break ; case QUAD_TO : final Point3dfx pt = this . coords . get ( i + 1 ) ; if ( ( point . equals ( currentPoint ) ) || ( point . equals ( pt ) ) ) { this . coords . remove ( i , i + 2 ) ; this . types . remove ( j ) ; return true ; } i += 2 ; break ; case ARC_TO : throw new IllegalStateException ( ) ; //$CASES-OMITTED$ default : break ; } } } return false ; } | Remove the point from this path . | 427 | 7 |
6,168 | public ImmutableListMultimap < Symbol , EDLMention > loadEDLMentionsByDocFrom ( CharSource source ) throws IOException { final ImmutableList < EDLMention > edlMentions = loadEDLMentionsFrom ( source ) ; final ImmutableListMultimap . Builder < Symbol , EDLMention > byDocs = ImmutableListMultimap . < Symbol , EDLMention > builder ( ) . orderKeysBy ( SymbolUtils . byStringOrdering ( ) ) ; for ( final EDLMention edlMention : edlMentions ) { byDocs . put ( edlMention . documentID ( ) , edlMention ) ; } return byDocs . build ( ) ; } | Loads EDL mentions grouped by document . Multimap keys are in alphabetical order by document ID . | 161 | 22 |
6,169 | private void writeSingleExp ( String arg0 , Map result , DssatCommonOutput output , String file ) { futFiles . put ( file , executor . submit ( new DssatTranslateRunner ( output , result , arg0 ) ) ) ; } | Write files and add file objects in the array | 55 | 9 |
6,170 | public static Vector3i convert ( Tuple3D < ? > tuple ) { if ( tuple instanceof Vector3i ) { return ( Vector3i ) tuple ; } return new Vector3i ( tuple . getX ( ) , tuple . getY ( ) , tuple . getZ ( ) ) ; } | Convert the given tuple to a real Vector3i . | 65 | 12 |
6,171 | @ Pure public static String getFirstFreeBusHubName ( BusNetwork busnetwork ) { int nb = busnetwork . getBusHubCount ( ) ; String name ; do { ++ nb ; name = Locale . getString ( "NAME_TEMPLATE" , //$NON-NLS-1$ Integer . toString ( nb ) ) ; } while ( busnetwork . getBusHub ( name ) != null ) ; return name ; } | Replies a bus hub name that was not exist in the specified bus network . | 98 | 16 |
6,172 | @ Override @ Pure public GeoLocation getGeoLocation ( ) { final Rectangle2d b = getBoundingBox ( ) ; if ( b == null ) { return new GeoLocationNowhere ( getUUID ( ) ) ; } return new GeoLocationPoint ( b . getCenterX ( ) , b . getCenterY ( ) ) ; } | Replies the geo - location of this hub . | 75 | 10 |
6,173 | @ Pure public double distance ( double x , double y ) { double dist = Double . POSITIVE_INFINITY ; if ( isValidPrimitive ( ) ) { for ( final BusStop stop : this . busStops ) { final double d = stop . distance ( x , y ) ; if ( ! Double . isNaN ( d ) && d < dist ) { dist = d ; } } } return Double . isInfinite ( dist ) ? Double . NaN : dist ; } | Replies the distance between the given point and this bus hub . | 105 | 13 |
6,174 | boolean addBusStop ( BusStop busStop , boolean fireEvents ) { if ( busStop == null ) { return false ; } if ( this . busStops . indexOf ( busStop ) != - 1 ) { return false ; } if ( ! this . busStops . add ( busStop ) ) { return false ; } busStop . addBusHub ( this ) ; resetBoundingBox ( ) ; if ( fireEvents ) { firePrimitiveChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_ADDED , busStop , this . busStops . size ( ) - 1 , null , null , null ) ) ; checkPrimitiveValidity ( ) ; } return true ; } | Add a bus stop inside the bus hub . | 152 | 9 |
6,175 | public void removeAllBusStops ( ) { for ( final BusStop busStop : this . busStops ) { busStop . removeBusHub ( this ) ; } this . busStops . clear ( ) ; resetBoundingBox ( ) ; firePrimitiveChanged ( new BusChangeEvent ( this , BusChangeEventType . ALL_STOPS_REMOVED , null , - 1 , null , null , null ) ) ; checkPrimitiveValidity ( ) ; } | Remove all the bus stops from the current hub . | 101 | 10 |
6,176 | public boolean removeBusStop ( BusStop busStop ) { final int index = this . busStops . indexOf ( busStop ) ; if ( index >= 0 ) { this . busStops . remove ( index ) ; busStop . removeBusHub ( this ) ; resetBoundingBox ( ) ; firePrimitiveChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_REMOVED , busStop , index , null , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } return false ; } | Remove a bus stop from this hub . | 116 | 8 |
6,177 | @ Pure public BusStop [ ] busStopsArray ( ) { return Collections . unmodifiableList ( this . busStops ) . toArray ( new BusStop [ this . busStops . size ( ) ] ) ; } | Replies the array of the bus stops . This function copies the bus stops in an array . | 49 | 19 |
6,178 | protected void defineSmallRectangle ( ZoomableGraphicsContext gc , T element ) { final double ptsSize = element . getPointSize ( ) / 2. ; final double x = element . getX ( ) - ptsSize ; final double y = element . getY ( ) - ptsSize ; final double mx = element . getX ( ) + ptsSize ; final double my = element . getY ( ) + ptsSize ; gc . moveTo ( x , y ) ; gc . lineTo ( mx , y ) ; gc . lineTo ( mx , my ) ; gc . lineTo ( x , my ) ; gc . closePath ( ) ; } | Define a path that corresponds to the small rectangle around a point . | 146 | 14 |
6,179 | @ Override public final void setUUID ( UUID id ) { final UUID oldId = getUUID ( ) ; if ( ( oldId != null && ! oldId . equals ( id ) ) || ( oldId == null && id != null ) ) { super . setUUID ( oldId ) ; fireElementChanged ( ) ; } } | Set the unique identifier for element . | 75 | 7 |
6,180 | public final void addLayerListener ( MapLayerListener listener ) { if ( this . listeners == null ) { this . listeners = new ListenerCollection <> ( ) ; } this . listeners . add ( MapLayerListener . class , listener ) ; } | Add a listener on the layer s events . | 52 | 9 |
6,181 | public final void removeLayerListener ( MapLayerListener listener ) { if ( this . listeners != null ) { this . listeners . remove ( MapLayerListener . class , listener ) ; if ( this . listeners . isEmpty ( ) ) { this . listeners = null ; } } } | Remove a listener on the layer s events . | 58 | 9 |
6,182 | @ Override public void onAttributeChangeEvent ( AttributeChangeEvent event ) { super . onAttributeChangeEvent ( event ) ; fireLayerAttributeChangedEvent ( new MapLayerAttributeChangeEvent ( this , event ) ) ; fireElementChanged ( ) ; if ( ATTR_VISIBLE . equals ( event . getName ( ) ) ) { final AttributeValue nValue = event . getValue ( ) ; boolean cvalue ; try { cvalue = nValue . getBoolean ( ) ; } catch ( Exception exception ) { cvalue = isVisible ( ) ; } if ( cvalue ) { final GISLayerContainer < ? > container = getContainer ( ) ; if ( container instanceof GISBrowsable ) { ( ( GISBrowsable ) container ) . setVisible ( cvalue , false ) ; } } } } | Invoked when the attribute s value changed . | 178 | 9 |
6,183 | @ Pure public boolean isClickable ( ) { final AttributeValue val = getAttributeProvider ( ) . getAttribute ( ATTR_CLICKABLE ) ; if ( val != null ) { try { return val . getBoolean ( ) ; } catch ( AttributeException e ) { // } } return true ; } | Replies if this layer accepts the user clicks . | 67 | 10 |
6,184 | @ Pure public final boolean isTemporaryLayer ( ) { MapLayer layer = this ; GISLayerContainer < ? > container ; while ( layer != null ) { if ( layer . isTemp ) { return true ; } container = layer . getContainer ( ) ; layer = container instanceof MapLayer ? ( MapLayer ) container : null ; } return false ; } | Replies if this layer was mark as temporary lyer . | 76 | 12 |
6,185 | @ Pure public boolean isRemovable ( ) { final AttributeValue val = getAttributeProvider ( ) . getAttribute ( ATTR_REMOVABLE ) ; if ( val != null ) { try { return val . getBoolean ( ) ; } catch ( AttributeException e ) { // } } return true ; } | Replies if this layer is removable from this container . This removal value permits to the container to be informed about the desired removal state from its component . The usage of this state by the container depends only of its implementation . | 67 | 44 |
6,186 | public void setProperties ( Point3d center , DoubleProperty radius1 ) { setProperties ( center . xProperty , center . yProperty , center . zProperty , radius1 ) ; } | Bind the frame of the sphere with center and radisu properties . | 41 | 13 |
6,187 | @ Pure public Point3f getCenterWithoutProperties ( ) { return new Point3f ( this . cxProperty . doubleValue ( ) , this . cyProperty . doubleValue ( ) , this . czProperty . doubleValue ( ) ) ; } | Replies the center . | 52 | 5 |
6,188 | public void setCenterProperties ( Point3d center ) { this . cxProperty = center . xProperty ; this . cyProperty = center . yProperty ; this . czProperty = center . zProperty ; } | Set the center properties with the properties of the Point3d in parameter . | 44 | 15 |
6,189 | public void setCenterProperties ( DoubleProperty x , DoubleProperty y , DoubleProperty z ) { this . cxProperty = x ; this . cyProperty = y ; this . czProperty = z ; } | Set the center properties with the properties in parameter . | 42 | 10 |
6,190 | public void setRadiusProperty ( DoubleProperty radius1 ) { this . radiusProperty = radius1 ; this . radiusProperty . set ( Math . abs ( this . radiusProperty . get ( ) ) ) ; } | Set the radius property with the property in parameter . | 44 | 10 |
6,191 | public static Function < EREEventMention , TYPE > typeFunction ( ) { return new Function < EREEventMention , TYPE > ( ) { @ Override public TYPE apply ( final EREEventMention input ) { return input . getType ( ) ; } } ; } | guava style functions | 60 | 4 |
6,192 | public static Object displayURLonStandardBrowser ( final Component parentComponent , final String url ) { Object obj = null ; try { if ( System . getProperty ( SYSTEM_PROPERTY_OS_NAME ) . startsWith ( OS . MAC . getOs ( ) ) ) { obj = openURLinMacOS ( url ) ; } else if ( System . getProperty ( SYSTEM_PROPERTY_OS_NAME ) . startsWith ( OS . WINDOWS . getOs ( ) ) ) { obj = openURLinWindowsOS ( url ) ; } else { // if operate syste is Unix or Linux obj = openURLinUnixOS ( url ) ; } } catch ( final Exception e ) { JOptionPane . showMessageDialog ( parentComponent , "An exception occured attempting to run the default web browser\n" + e . toString ( ) ) ; } return obj ; } | This method opens the specified url in the standard web - browser . | 189 | 13 |
6,193 | private static Object openURLinMacOS ( final String url ) throws ClassNotFoundException , NoSuchMethodException , IllegalAccessException , InvocationTargetException { final Class < ? > fileManagerClass = Class . forName ( MAC_FILE_MANAGER ) ; final Method openURL = fileManagerClass . getDeclaredMethod ( "openURL" , new Class [ ] { String . class } ) ; return openURL . invoke ( null , new Object [ ] { url } ) ; } | Opens the given URL in mac os . | 104 | 9 |
6,194 | private static Boolean openURLinUnixOS ( final String url ) throws InterruptedException , IOException , Exception { Boolean executed = false ; for ( final Browsers browser : Browsers . values ( ) ) { if ( ! executed ) { executed = Runtime . getRuntime ( ) . exec ( new String [ ] { UNIX_COMMAND_WHICH , browser . getBrowserName ( ) } ) . waitFor ( ) == 0 ; if ( executed ) { Runtime . getRuntime ( ) . exec ( new String [ ] { browser . getBrowserName ( ) , url } ) ; } } } if ( ! executed ) { throw new Exception ( Arrays . toString ( Browsers . values ( ) ) ) ; } return executed ; } | Opens the given URL in unix os . | 159 | 10 |
6,195 | private static Process openURLinWindowsOS ( final String url ) throws IOException { String cmd = null ; cmd = WINDOWS_PATH + " " + WINDOWS_FLAG + " " ; return Runtime . getRuntime ( ) . exec ( cmd + url ) ; } | Opens the given URL in windows os . | 58 | 9 |
6,196 | protected void onInitializeGroupLayout ( ) { javax . swing . GroupLayout layout = new javax . swing . GroupLayout ( this ) ; this . setLayout ( layout ) ; layout . setHorizontalGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( layout . createSequentialGroup ( ) . addContainerGap ( ) . addComponent ( scrTree , javax . swing . GroupLayout . PREFERRED_SIZE , 384 , javax . swing . GroupLayout . PREFERRED_SIZE ) . addContainerGap ( javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) ) ) ; layout . setVerticalGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( layout . createSequentialGroup ( ) . addContainerGap ( ) . addComponent ( scrTree , javax . swing . GroupLayout . DEFAULT_SIZE , 536 , Short . MAX_VALUE ) . addContainerGap ( ) ) ) ; } | On initialize group layout . | 248 | 5 |
6,197 | public static void displayVersionInfo ( String command ) { String version = ProxyInitStrategy . class . getPackage ( ) . getImplementationVersion ( ) ; if ( version == null ) { version = "N/A" ; } System . out . format ( "%s v. %s (%s)\n" , command , version , getAPIVersionString ( ) ) ; } | Display version information . | 81 | 4 |
6,198 | @ Pure public static boolean intersectsOrientedBoxCapsule ( double centerx , double centery , double centerz , double axis1x , double axis1y , double axis1z , double axis2x , double axis2y , double axis2z , double axis3x , double axis3y , double axis3z , double extentAxis1 , double extentAxis2 , double extentAxis3 , double capsule1Ax , double capsule1Ay , double capsule1Az , double capsule1Bx , double capsule1By , double capsule1Bz , double capsule1Radius ) { Point3f closestFromA = new Point3f ( ) ; Point3f closestFromB = new Point3f ( ) ; computeClosestFarestOBBPoints ( capsule1Ax , capsule1Ay , capsule1Az , centerx , centery , centerz , axis1x , axis1y , axis1z , axis2x , axis2y , axis2z , axis3x , axis3y , axis3z , extentAxis1 , extentAxis2 , extentAxis3 , closestFromA , null ) ; computeClosestFarestOBBPoints ( capsule1Bx , capsule1By , capsule1Bz , centerx , centery , centerz , axis1x , axis1y , axis1z , axis2x , axis2y , axis2z , axis3x , axis3y , axis3z , extentAxis1 , extentAxis2 , extentAxis3 , closestFromB , null ) ; double distance = AbstractSegment3F . distanceSquaredSegmentSegment ( capsule1Ax , capsule1Ay , capsule1Az , capsule1Bx , capsule1By , capsule1Bz , closestFromA . getX ( ) , closestFromA . getY ( ) , closestFromA . getZ ( ) , closestFromB . getX ( ) , closestFromB . getY ( ) , closestFromB . getZ ( ) ) ; return ( distance <= ( capsule1Radius * capsule1Radius ) ) ; } | Compute intersection between an OBB and a capsule . | 453 | 11 |
6,199 | public void setFromPointCloud ( Iterable < ? extends Point3D > pointCloud ) { Vector3f r = new Vector3f ( ) ; Vector3f s = new Vector3f ( ) ; Vector3f t = new Vector3f ( ) ; Point3f c = new Point3f ( ) ; double [ ] extents = new double [ 3 ] ; computeOBBCenterAxisExtents ( pointCloud , r , s , t , c , extents ) ; set ( c . getX ( ) , c . getY ( ) , c . getZ ( ) , r . getX ( ) , r . getY ( ) , r . getZ ( ) , s . getX ( ) , s . getY ( ) , s . getZ ( ) , extents [ 0 ] , extents [ 1 ] , extents [ 2 ] ) ; } | Set the oriented box from a could of points . | 189 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.