idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
16,700 | protected void handleProperty ( final String name , final LexicalUnit value , final boolean important , final Locator locator ) { getDocumentHandler ( ) . property ( name , value , important , locator ) ; } | property handler . | 45 | 3 |
16,701 | protected LexicalUnit functionInternal ( final LexicalUnit prev , final String funct , final LexicalUnit params ) { if ( "counter(" . equalsIgnoreCase ( funct ) ) { return LexicalUnitImpl . createCounter ( prev , params ) ; } else if ( "counters(" . equalsIgnoreCase ( funct ) ) { return LexicalUnitImpl . createCounters ( prev , params ) ; } else if ( "attr(" . equalsIgnoreCase ( funct ) ) { return LexicalUnitImpl . createAttr ( prev , params . getStringValue ( ) ) ; } else if ( "rect(" . equalsIgnoreCase ( funct ) ) { return LexicalUnitImpl . createRect ( prev , params ) ; } else if ( "rgb(" . equalsIgnoreCase ( funct ) ) { return LexicalUnitImpl . createRgbColor ( prev , params ) ; } return LexicalUnitImpl . createFunction ( prev , funct . substring ( 0 , funct . length ( ) - 1 ) , params ) ; } | Process a function decl . | 229 | 5 |
16,702 | protected LexicalUnit hexcolorInternal ( final LexicalUnit prev , final Token t ) { // Step past the hash at the beginning final int i = 1 ; int r = 0 ; int g = 0 ; int b = 0 ; final int len = t . image . length ( ) - 1 ; try { if ( len == 3 ) { r = Integer . parseInt ( t . image . substring ( i + 0 , i + 1 ) , 16 ) ; g = Integer . parseInt ( t . image . substring ( i + 1 , i + 2 ) , 16 ) ; b = Integer . parseInt ( t . image . substring ( i + 2 , i + 3 ) , 16 ) ; r = ( r << 4 ) | r ; g = ( g << 4 ) | g ; b = ( b << 4 ) | b ; } else if ( len == 6 ) { r = Integer . parseInt ( t . image . substring ( i + 0 , i + 2 ) , 16 ) ; g = Integer . parseInt ( t . image . substring ( i + 2 , i + 4 ) , 16 ) ; b = Integer . parseInt ( t . image . substring ( i + 4 , i + 6 ) , 16 ) ; } else { final String pattern = getParserMessage ( "invalidColor" ) ; throw new CSSParseException ( MessageFormat . format ( pattern , new Object [ ] { t } ) , getInputSource ( ) . getURI ( ) , t . beginLine , t . beginColumn ) ; } // Turn into an "rgb()" final LexicalUnit lr = LexicalUnitImpl . createNumber ( null , r ) ; final LexicalUnit lc1 = LexicalUnitImpl . createComma ( lr ) ; final LexicalUnit lg = LexicalUnitImpl . createNumber ( lc1 , g ) ; final LexicalUnit lc2 = LexicalUnitImpl . createComma ( lg ) ; LexicalUnitImpl . createNumber ( lc2 , b ) ; return LexicalUnitImpl . createRgbColor ( prev , lr ) ; } catch ( final NumberFormatException ex ) { final String pattern = getParserMessage ( "invalidColor" ) ; throw new CSSParseException ( MessageFormat . format ( pattern , new Object [ ] { t } ) , getInputSource ( ) . getURI ( ) , t . beginLine , t . beginColumn , ex ) ; } } | Processes a hexadecimal color definition . | 529 | 10 |
16,703 | protected int intValue ( final char op , final String s ) { final int result = Integer . parseInt ( s ) ; if ( op == ' ' ) { return - 1 * result ; } return result ; } | Parses the sting into an integer . | 45 | 9 |
16,704 | protected double doubleValue ( final char op , final String s ) { final double result = Double . parseDouble ( s ) ; if ( op == ' ' ) { return - 1 * result ; } return result ; } | Parses the sting into an double . | 45 | 9 |
16,705 | protected int getLastNumPos ( final String s ) { int i = 0 ; for ( ; i < s . length ( ) ; i ++ ) { if ( NUM_CHARS . indexOf ( s . charAt ( i ) ) < 0 ) { break ; } } return i - 1 ; } | Returns the pos of the last numeric char in the given string . | 64 | 13 |
16,706 | public static void sortByNumberOfVersionsDesc ( List < ClasspathResource > resources ) { // sort by number of version occurrences Comparator < ClasspathResource > sortByNumberOfVersionsDesc = new Comparator < ClasspathResource > ( ) { @ Override public int compare ( ClasspathResource resource1 , ClasspathResource resource2 ) { return - 1 * new Integer ( resource1 . getResourceFileVersions ( ) . size ( ) ) . compareTo ( resource2 . getResourceFileVersions ( ) . size ( ) ) ; } } ; Collections . sort ( resources , sortByNumberOfVersionsDesc ) ; } | Takes a list of classpath resources and sorts them by the number of classpath versions . | 129 | 19 |
16,707 | public static List < ClasspathResource > findResourcesWithDuplicates ( List < ClasspathResource > resourceFiles , boolean excludeSameSizeDups ) { List < ClasspathResource > resourcesWithDuplicates = new ArrayList <> ( ) ; // keep only entries with duplicates for ( ClasspathResource resource : resourceFiles ) { if ( resource . hasDuplicates ( excludeSameSizeDups ) ) { resourcesWithDuplicates . add ( resource ) ; } } return resourcesWithDuplicates ; } | Inspects a given list of classpath resources and returns only the resources that contain multiple versions . | 108 | 20 |
16,708 | public void setMediaText ( final String mediaText ) throws DOMException { try { final CSSOMParser parser = new CSSOMParser ( ) ; parser . setErrorHandler ( ThrowCssExceptionErrorHandler . INSTANCE ) ; final MediaQueryList sml = parser . parseMedia ( mediaText ) ; setMediaList ( sml ) ; } catch ( final CSSParseException e ) { throw new DOMException ( DOMException . SYNTAX_ERR , e . getLocalizedMessage ( ) ) ; } catch ( final IOException e ) { throw new DOMException ( DOMException . NOT_FOUND_ERR , e . getLocalizedMessage ( ) ) ; } } | Parses the given media text . | 145 | 8 |
16,709 | public void setMedia ( final List < String > media ) { mediaQueries_ . clear ( ) ; for ( String medium : media ) { mediaQueries_ . add ( new MediaQuery ( medium ) ) ; } } | Resets the list of media queries . | 47 | 8 |
16,710 | public CSSStyleSheetImpl parseStyleSheet ( final InputSource source , final String href ) throws IOException { final CSSOMHandler handler = new CSSOMHandler ( ) ; handler . setHref ( href ) ; parser_ . setDocumentHandler ( handler ) ; parser_ . parseStyleSheet ( source ) ; final Object o = handler . getRoot ( ) ; if ( o instanceof CSSStyleSheetImpl ) { return ( CSSStyleSheetImpl ) o ; } return null ; } | Parses a SAC input source into a CSSOM style sheet . | 105 | 15 |
16,711 | public CSSValueImpl parsePropertyValue ( final String propertyValue ) throws IOException { try ( InputSource source = new InputSource ( new StringReader ( propertyValue ) ) ) { final CSSOMHandler handler = new CSSOMHandler ( ) ; parser_ . setDocumentHandler ( handler ) ; final LexicalUnit lu = parser_ . parsePropertyValue ( source ) ; if ( null == lu ) { return null ; } return new CSSValueImpl ( lu ) ; } } | Parses a input string into a CSSValue . | 101 | 11 |
16,712 | public AbstractCSSRuleImpl parseRule ( final String rule ) throws IOException { try ( InputSource source = new InputSource ( new StringReader ( rule ) ) ) { final CSSOMHandler handler = new CSSOMHandler ( ) ; parser_ . setDocumentHandler ( handler ) ; parser_ . parseRule ( source ) ; return ( AbstractCSSRuleImpl ) handler . getRoot ( ) ; } } | Parses a string into a CSSRule . | 83 | 10 |
16,713 | public SelectorList parseSelectors ( final String selectors ) throws IOException { try ( InputSource source = new InputSource ( new StringReader ( selectors ) ) ) { final HandlerBase handler = new HandlerBase ( ) ; parser_ . setDocumentHandler ( handler ) ; return parser_ . parseSelectors ( source ) ; } } | Parses a string into a CSSSelectorList . | 71 | 12 |
16,714 | public MediaQueryList parseMedia ( final String media ) throws IOException { try ( InputSource source = new InputSource ( new StringReader ( media ) ) ) { final HandlerBase handler = new HandlerBase ( ) ; parser_ . setDocumentHandler ( handler ) ; if ( parser_ instanceof AbstractCSSParser ) { return ( ( AbstractCSSParser ) parser_ ) . parseMedia ( source ) ; } return null ; } } | Parses a string into a MediaQueryList . | 91 | 11 |
16,715 | public String removeProperty ( final String propertyName ) throws DOMException { if ( null == propertyName ) { return "" ; } for ( int i = 0 ; i < properties_ . size ( ) ; i ++ ) { final Property p = properties_ . get ( i ) ; if ( p != null && propertyName . equalsIgnoreCase ( p . getName ( ) ) ) { properties_ . remove ( i ) ; if ( p . getValue ( ) == null ) { return "" ; } return p . getValue ( ) . toString ( ) ; } } return "" ; } | Remove a property . | 124 | 4 |
16,716 | public void insertRule ( final String rule , final int index ) throws DOMException { final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheet ( ) ; try { final CSSOMParser parser = new CSSOMParser ( ) ; parser . setParentStyleSheet ( parentStyleSheet ) ; parser . setErrorHandler ( ThrowCssExceptionErrorHandler . INSTANCE ) ; final AbstractCSSRuleImpl r = parser . parseRule ( rule ) ; // Insert the rule into the list of rules getCssRules ( ) . insert ( r , index ) ; } catch ( final IndexOutOfBoundsException e ) { throw new DOMExceptionImpl ( DOMException . INDEX_SIZE_ERR , DOMExceptionImpl . INDEX_OUT_OF_BOUNDS , e . getMessage ( ) ) ; } catch ( final CSSException e ) { throw new DOMExceptionImpl ( DOMException . SYNTAX_ERR , DOMExceptionImpl . SYNTAX_ERROR , e . getMessage ( ) ) ; } catch ( final IOException e ) { throw new DOMExceptionImpl ( DOMException . SYNTAX_ERR , DOMExceptionImpl . SYNTAX_ERROR , e . getMessage ( ) ) ; } } | Insert a new rule at the given index . | 265 | 9 |
16,717 | public static String trimBy ( final StringBuilder s , final int left , final int right ) { return s . substring ( left , s . length ( ) - right ) ; } | Remove the given number of chars from start and end . There is no parameter checking the caller has to take care of this . | 38 | 25 |
16,718 | @ Override public String getMessage ( ) { if ( message_ != null ) { return message_ ; } if ( getCause ( ) != null ) { return getCause ( ) . getMessage ( ) ; } switch ( code_ ) { case UNSPECIFIED_ERR : return "unknown error" ; case NOT_SUPPORTED_ERR : return "not supported" ; case SYNTAX_ERR : return "syntax error" ; default : return null ; } } | Returns the detail message of this throwable object . | 104 | 10 |
16,719 | public void addCondition ( final Condition condition ) { if ( conditions_ == null ) { conditions_ = new ArrayList <> ( ) ; } conditions_ . add ( condition ) ; } | Add a condition . | 39 | 4 |
16,720 | public void setSelectorText ( final String selectorText ) throws DOMException { try { final CSSOMParser parser = new CSSOMParser ( ) ; selectors_ = parser . parseSelectors ( selectorText ) ; } catch ( final CSSException e ) { throw new DOMExceptionImpl ( DOMException . SYNTAX_ERR , DOMExceptionImpl . SYNTAX_ERROR , e . getMessage ( ) ) ; } catch ( final IOException e ) { throw new DOMExceptionImpl ( DOMException . SYNTAX_ERR , DOMExceptionImpl . SYNTAX_ERROR , e . getMessage ( ) ) ; } } | Sets the selector text . | 137 | 6 |
16,721 | public static void setDebugAll ( final boolean bDebug ) { setDebugText ( bDebug ) ; setDebugFont ( bDebug ) ; setDebugSplit ( bDebug ) ; setDebugPrepare ( bDebug ) ; setDebugRender ( bDebug ) ; } | Shortcut to globally en - or disable debugging | 55 | 9 |
16,722 | public Version withPreRelease ( String newPreRelease ) { require ( newPreRelease != null , "newPreRelease is null" ) ; final String [ ] newPreReleaseParts = parsePreRelease ( newPreRelease ) ; return new Version ( this . major , this . minor , this . patch , newPreReleaseParts , this . buildMetaDataParts ) ; } | Creates a new Version from this one replacing only the pre - release part with the given String . All other parts will remain the same as in this Version . You can remove the pre - release part by passing an empty String . | 77 | 46 |
16,723 | public Version withBuildMetaData ( String newBuildMetaData ) { require ( newBuildMetaData != null , "newBuildMetaData is null" ) ; final String [ ] newBuildMdParts = parseBuildMd ( newBuildMetaData ) ; return new Version ( this . major , this . minor , this . patch , this . preReleaseParts , newBuildMdParts ) ; } | Creates a new Version from this one replacing only the build - meta - data part with the given String . All other parts will remain the same as in this Version . You can remove the build - meta - data part by passing an empty String . | 84 | 50 |
16,724 | public Version nextPreRelease ( ) { final String [ ] newPreReleaseParts = incrementIdentifier ( this . preReleaseParts ) ; return new Version ( this . major , this . minor , this . patch , newPreReleaseParts , EMPTY_ARRAY ) ; } | Derives a new Version instance from this one by only incrementing the pre - release identifier . The build - meta - data will be dropped all other fields remain the same . | 57 | 35 |
16,725 | public Version nextBuildMetaData ( ) { final String [ ] newBuildMetaData = incrementIdentifier ( this . buildMetaDataParts ) ; return new Version ( this . major , this . minor , this . patch , this . preReleaseParts , newBuildMetaData ) ; } | Derives a new Version instance from this one by only incrementing the build - meta - data identifier . All other fields remain the same . | 59 | 28 |
16,726 | private static int isNumeric ( String s ) { final char [ ] chars = s . toCharArray ( ) ; int num = 0 ; // note: this method does not account for leading zeroes as could occur in build // meta data parts. Leading zeroes are thus simply ignored when parsing the // number. for ( int i = 0 ; i < chars . length ; ++ i ) { final char c = chars [ i ] ; if ( c >= ' ' && c <= ' ' ) { num = num * DECIMAL + Character . digit ( c , DECIMAL ) ; } else { return - 1 ; } } return num ; } | Determines whether s is a positive number . If it is the number is returned otherwise the result is - 1 . | 138 | 24 |
16,727 | public String [ ] getPreReleaseParts ( ) { if ( this . preReleaseParts . length == 0 ) { return EMPTY_ARRAY ; } return Arrays . copyOf ( this . preReleaseParts , this . preReleaseParts . length ) ; } | Gets the pre release identifier parts of this version as array . Modifying the resulting array will have no influence on the internal state of this object . | 55 | 30 |
16,728 | public String [ ] getBuildMetaDataParts ( ) { if ( this . buildMetaDataParts . length == 0 ) { return EMPTY_ARRAY ; } return Arrays . copyOf ( this . buildMetaDataParts , this . buildMetaDataParts . length ) ; } | Gets the build meta data identifier parts of this version as array . Modifying the resulting array will have no influence on the internal state of this object . | 59 | 31 |
16,729 | public Version toUpperCase ( ) { return new Version ( this . major , this . minor , this . patch , copyCase ( this . preReleaseParts , true ) , copyCase ( this . buildMetaDataParts , true ) ) ; } | Returns a new Version where all identifiers are converted to upper case letters . | 52 | 14 |
16,730 | public Version toLowerCase ( ) { return new Version ( this . major , this . minor , this . patch , copyCase ( this . preReleaseParts , false ) , copyCase ( this . buildMetaDataParts , false ) ) ; } | Returns a new Version where all identifiers are converted to lower case letters . | 51 | 14 |
16,731 | private Object readResolve ( ) throws ObjectStreamException { if ( this . preRelease != null || this . buildMetaData != null ) { return createInternal ( this . major , this . minor , this . patch , this . preRelease , this . buildMetaData ) ; } return this ; } | Handles proper deserialization of objects serialized with a version prior to 1 . 1 . 0 | 63 | 20 |
16,732 | public static void avoidDoubleBorders ( @ Nonnull final PLTable ret ) { boolean bPreviousRowHasBottomBorder = false ; for ( int i = 0 ; i < ret . getRowCount ( ) ; i ++ ) { boolean bRowHasBottomBorder = true ; boolean bRowHasTopBorder = true ; final PLTableRow aRow = ret . getRowAtIndex ( i ) ; for ( int j = 0 ; j < aRow . getColumnCount ( ) ; j ++ ) { final PLTableCell aCell = aRow . getCellAtIndex ( j ) ; if ( aCell . getBorderBottomWidth ( ) == 0 ) bRowHasBottomBorder = false ; if ( aCell . getBorderTopWidth ( ) == 0 ) bRowHasTopBorder = false ; } if ( bPreviousRowHasBottomBorder && bRowHasTopBorder ) aRow . setBorderTop ( null ) ; bPreviousRowHasBottomBorder = bRowHasBottomBorder ; } } | If two joined rows both have borders at their connecting side the doubles width has to be removed | 208 | 18 |
16,733 | @ Nonnull public FontSpec getCloneWithDifferentFont ( @ Nonnull final PreloadFont aNewFont ) { ValueEnforcer . notNull ( aNewFont , "NewFont" ) ; if ( aNewFont . equals ( m_aPreloadFont ) ) return this ; // Don't copy loaded font! return new FontSpec ( aNewFont , m_fFontSize , m_aColor ) ; } | Return a clone of this object but with a different font . | 89 | 12 |
16,734 | @ Nonnull public FontSpec getCloneWithDifferentFontSize ( final float fNewFontSize ) { ValueEnforcer . isGT0 ( fNewFontSize , "FontSize" ) ; if ( EqualsHelper . equals ( fNewFontSize , m_fFontSize ) ) return this ; return new FontSpec ( m_aPreloadFont , fNewFontSize , m_aColor ) ; } | Return a clone of this object but with a different font size . | 81 | 13 |
16,735 | @ Nonnull public FontSpec getCloneWithDifferentColor ( @ Nonnull final Color aNewColor ) { ValueEnforcer . notNull ( aNewColor , "NewColor" ) ; if ( aNewColor . equals ( m_aColor ) ) return this ; return new FontSpec ( m_aPreloadFont , m_fFontSize , aNewColor ) ; } | Return a clone of this object but with a different color . | 80 | 12 |
16,736 | @ Nonnegative public float getEffectiveValue ( final float fAvailableHeight ) { switch ( m_eType ) { case ABSOLUTE : return Math . min ( m_fValue , fAvailableHeight ) ; case PERCENTAGE : return fAvailableHeight * m_fValue / 100 ; default : throw new IllegalStateException ( "Unsupported: " + m_eType + " - must be calculated outside!" ) ; } } | Get the effective height based on the passed available height . This may not be called for star or auto height elements . | 91 | 23 |
16,737 | @ Nonnull public static HeightSpec abs ( @ Nonnegative final float fValue ) { ValueEnforcer . isGT0 ( fValue , "Value" ) ; return new HeightSpec ( EValueUOMType . ABSOLUTE , fValue ) ; } | Create a height element with an absolute value . | 54 | 9 |
16,738 | @ Nonnull public static HeightSpec perc ( @ Nonnegative final float fPerc ) { ValueEnforcer . isGT0 ( fPerc , "Perc" ) ; return new HeightSpec ( EValueUOMType . PERCENTAGE , fPerc ) ; } | Create a height element with an percentage value . | 59 | 9 |
16,739 | @ Nonnull @ ReturnsMutableCopy public static PLTable createWithPercentage ( @ Nonnull @ Nonempty final float ... aPercentages ) { ValueEnforcer . notEmpty ( aPercentages , "Percentages" ) ; final ICommonsList < WidthSpec > aWidths = new CommonsArrayList <> ( aPercentages . length ) ; for ( final float fPercentage : aPercentages ) aWidths . ( WidthSpec . perc ( fPercentage ) ) ; return new PLTable ( aWidths ) ; } | Create a new table with the specified percentages . | 115 | 9 |
16,740 | @ Nonnull @ ReturnsMutableCopy public static PLTable createWithEvenlySizedColumns ( @ Nonnegative final int nColumnCount ) { ValueEnforcer . isGT0 ( nColumnCount , "ColumnCount" ) ; final ICommonsList < WidthSpec > aWidths = new CommonsArrayList <> ( nColumnCount ) ; for ( int i = 0 ; i < nColumnCount ; ++ i ) aWidths . ( WidthSpec . star ( ) ) ; return new PLTable ( aWidths ) ; } | Create a new table with evenly sized columns . | 114 | 9 |
16,741 | private void _setPreparedSize ( @ Nonnull final SizeSpec aPreparedSize ) { ValueEnforcer . notNull ( aPreparedSize , "PreparedSize" ) ; m_bPrepared = true ; m_aPreparedSize = aPreparedSize ; m_aRenderSize = getRenderSize ( aPreparedSize ) ; if ( PLDebugLog . isDebugPrepare ( ) ) { String sSuffix = "" ; if ( this instanceof IPLHasMarginBorderPadding < ? > ) { sSuffix = " with " + PLDebugLog . getXMBP ( ( IPLHasMarginBorderPadding < ? > ) this ) + " and " + PLDebugLog . getYMBP ( ( IPLHasMarginBorderPadding < ? > ) this ) ; } PLDebugLog . debugPrepare ( this , "Prepared object: " + PLDebugLog . getWH ( aPreparedSize ) + sSuffix + "; Render size: " + PLDebugLog . getWH ( m_aRenderSize ) ) ; } } | Set the prepared size of this object . This method also handles min and max size | 238 | 16 |
16,742 | @ Nonnull protected final IMPLTYPE internalMarkAsPrepared ( @ Nonnull final SizeSpec aPreparedSize ) { // Prepare only once! internalCheckNotPrepared ( ) ; _setPreparedSize ( aPreparedSize ) ; return thisAsT ( ) ; } | INTERNAL method . Do not call from outside! | 59 | 11 |
16,743 | public void setFont ( final PDFont font , final float fontSize ) throws IOException { if ( fontStack . isEmpty ( ) ) fontStack . add ( font ) ; else fontStack . set ( fontStack . size ( ) - 1 , font ) ; PDDocumentHelper . handleFontSubset ( m_aDoc , font ) ; writeOperand ( resources . add ( font ) ) ; writeOperand ( fontSize ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; } | Set the font and font size to draw text with . | 110 | 11 |
16,744 | public void showText ( final String text ) throws IOException { if ( ! inTextMode ) { throw new IllegalStateException ( "Must call beginText() before showText()" ) ; } if ( fontStack . isEmpty ( ) ) { throw new IllegalStateException ( "Must call setFont() before showText()" ) ; } final PDFont font = fontStack . peek ( ) ; // Unicode code points to keep when subsetting if ( font . willBeSubset ( ) ) { for ( int offset = 0 ; offset < text . length ( ) ; ) { final int codePoint = text . codePointAt ( offset ) ; font . addToSubset ( codePoint ) ; offset += Character . charCount ( codePoint ) ; } } COSWriter . writeString ( font . encode ( text ) , m_aOS ) ; write ( ( byte ) ' ' ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; } | Shows the given text at the location specified by the current text matrix . | 207 | 15 |
16,745 | public void setTextMatrix ( final Matrix matrix ) throws IOException { if ( ! inTextMode ) { throw new IllegalStateException ( "Error: must call beginText() before setTextMatrix" ) ; } writeAffineTransform ( matrix . createAffineTransform ( ) ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; } | The Tm operator . Sets the text matrix to the given values . A current text matrix will be replaced with the new one . | 77 | 26 |
16,746 | public void drawImage ( final PDImageXObject image , final float x , final float y ) throws IOException { drawImage ( image , x , y , image . getWidth ( ) , image . getHeight ( ) ) ; } | Draw an image at the x y coordinates with the default size of the image . | 49 | 16 |
16,747 | public void drawImage ( final PDImageXObject image , final float x , final float y , final float width , final float height ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: drawImage is not allowed within a text block." ) ; } saveGraphicsState ( ) ; final AffineTransform transform = new AffineTransform ( width , 0 , 0 , height , x , y ) ; transform ( new Matrix ( transform ) ) ; writeOperand ( resources . add ( image ) ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; restoreGraphicsState ( ) ; } | Draw an image at the x y coordinates with the given size . | 136 | 13 |
16,748 | public void drawImage ( final PDInlineImage inlineImage , final float x , final float y ) throws IOException { drawImage ( inlineImage , x , y , inlineImage . getWidth ( ) , inlineImage . getHeight ( ) ) ; } | Draw an inline image at the x y coordinates with the default size of the image . | 53 | 17 |
16,749 | public void drawImage ( final PDInlineImage inlineImage , final float x , final float y , final float width , final float height ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: drawImage is not allowed within a text block." ) ; } saveGraphicsState ( ) ; transform ( new Matrix ( width , 0 , 0 , height , x , y ) ) ; // create the image dictionary final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "BI" ) ; sb . append ( "\n /W " ) ; sb . append ( inlineImage . getWidth ( ) ) ; sb . append ( "\n /H " ) ; sb . append ( inlineImage . getHeight ( ) ) ; sb . append ( "\n /CS " ) ; sb . append ( "/" ) ; sb . append ( inlineImage . getColorSpace ( ) . getName ( ) ) ; if ( inlineImage . getDecode ( ) != null && inlineImage . getDecode ( ) . size ( ) > 0 ) { sb . append ( "\n /D " ) ; sb . append ( "[" ) ; for ( final COSBase base : inlineImage . getDecode ( ) ) { sb . append ( ( ( COSNumber ) base ) . intValue ( ) ) ; sb . append ( " " ) ; } sb . append ( "]" ) ; } if ( inlineImage . isStencil ( ) ) { sb . append ( "\n /IM true" ) ; } sb . append ( "\n /BPC " ) ; sb . append ( inlineImage . getBitsPerComponent ( ) ) ; // image dictionary write ( sb . toString ( ) ) ; writeLine ( ) ; // binary data writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; writeBytes ( inlineImage . getData ( ) ) ; writeLine ( ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; restoreGraphicsState ( ) ; } | Draw an inline image at the x y coordinates and a certain width and height . | 452 | 16 |
16,750 | public void drawForm ( final PDFormXObject form ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: drawForm is not allowed within a text block." ) ; } writeOperand ( resources . add ( form ) ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; } | Draws the given Form XObject at the current location . | 75 | 12 |
16,751 | public void saveGraphicsState ( ) throws IOException { if ( ! fontStack . isEmpty ( ) ) { fontStack . push ( fontStack . peek ( ) ) ; } if ( ! strokingColorSpaceStack . isEmpty ( ) ) { strokingColorSpaceStack . push ( strokingColorSpaceStack . peek ( ) ) ; } if ( ! nonStrokingColorSpaceStack . isEmpty ( ) ) { nonStrokingColorSpaceStack . push ( nonStrokingColorSpaceStack . peek ( ) ) ; } writeOperator ( ( byte ) ' ' ) ; } | q operator . Saves the current graphics state . | 125 | 10 |
16,752 | public void restoreGraphicsState ( ) throws IOException { if ( ! fontStack . isEmpty ( ) ) { fontStack . pop ( ) ; } if ( ! strokingColorSpaceStack . isEmpty ( ) ) { strokingColorSpaceStack . pop ( ) ; } if ( ! nonStrokingColorSpaceStack . isEmpty ( ) ) { nonStrokingColorSpaceStack . pop ( ) ; } writeOperator ( ( byte ) ' ' ) ; } | Q operator . Restores the current graphics state . | 99 | 10 |
16,753 | public void setStrokingColor ( final double g ) throws IOException { if ( _isOutsideOneInterval ( g ) ) { throw new IllegalArgumentException ( "Parameter must be within 0..1, but is " + g ) ; } writeOperand ( ( float ) g ) ; writeOperator ( ( byte ) ' ' ) ; } | Set the stroking color in the DeviceGray color space . Range is 0 .. 1 . | 75 | 18 |
16,754 | public void setNonStrokingColor ( final PDColor color ) throws IOException { if ( nonStrokingColorSpaceStack . isEmpty ( ) || nonStrokingColorSpaceStack . peek ( ) != color . getColorSpace ( ) ) { writeOperand ( getName ( color . getColorSpace ( ) ) ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; if ( nonStrokingColorSpaceStack . isEmpty ( ) ) { nonStrokingColorSpaceStack . add ( color . getColorSpace ( ) ) ; } else { nonStrokingColorSpaceStack . set ( nonStrokingColorSpaceStack . size ( ) - 1 , color . getColorSpace ( ) ) ; } } for ( final float value : color . getComponents ( ) ) { writeOperand ( value ) ; } if ( color . getColorSpace ( ) instanceof PDPattern ) { writeOperand ( color . getPatternName ( ) ) ; } if ( color . getColorSpace ( ) instanceof PDPattern || color . getColorSpace ( ) instanceof PDSeparation || color . getColorSpace ( ) instanceof PDDeviceN || color . getColorSpace ( ) instanceof PDICCBased ) { writeOperator ( ( byte ) ' ' , ( byte ) ' ' , ( byte ) ' ' ) ; } else { writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; } } | Sets the non - stroking color and if necessary the non - stroking color space . | 318 | 19 |
16,755 | public void setNonStrokingColor ( final Color color ) throws IOException { final float [ ] components = new float [ ] { color . getRed ( ) / 255f , color . getGreen ( ) / 255f , color . getBlue ( ) / 255f } ; final PDColor pdColor = new PDColor ( components , PDDeviceRGB . INSTANCE ) ; setNonStrokingColor ( pdColor ) ; } | Set the non - stroking color using an AWT color . Conversion uses the default sRGB color space . | 93 | 22 |
16,756 | public void setNonStrokingColor ( final int r , final int g , final int b ) throws IOException { if ( _isOutside255Interval ( r ) || _isOutside255Interval ( g ) || _isOutside255Interval ( b ) ) { throw new IllegalArgumentException ( "Parameters must be within 0..255, but are (" + r + "," + g + "," + b + ")" ) ; } writeOperand ( r / 255f ) ; writeOperand ( g / 255f ) ; writeOperand ( b / 255f ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; } | Set the non - stroking color in the DeviceRGB color space . Range is 0 .. 255 . | 143 | 20 |
16,757 | public void setNonStrokingColor ( final int c , final int m , final int y , final int k ) throws IOException { if ( _isOutside255Interval ( c ) || _isOutside255Interval ( m ) || _isOutside255Interval ( y ) || _isOutside255Interval ( k ) ) { throw new IllegalArgumentException ( "Parameters must be within 0..255, but are (" + c + "," + m + "," + y + "," + k + ")" ) ; } setNonStrokingColor ( c / 255f , m / 255f , y / 255f , k / 255f ) ; } | Set the non - stroking color in the DeviceCMYK color space . Range is 0 .. 255 . | 143 | 22 |
16,758 | public void setNonStrokingColor ( final double c , final double m , final double y , final double k ) throws IOException { if ( _isOutsideOneInterval ( c ) || _isOutsideOneInterval ( m ) || _isOutsideOneInterval ( y ) || _isOutsideOneInterval ( k ) ) { throw new IllegalArgumentException ( "Parameters must be within 0..1, but are (" + c + "," + m + "," + y + "," + k + ")" ) ; } writeOperand ( ( float ) c ) ; writeOperand ( ( float ) m ) ; writeOperand ( ( float ) y ) ; writeOperand ( ( float ) k ) ; writeOperator ( ( byte ) ' ' ) ; } | Set the non - stroking color in the DeviceRGB color space . Range is 0 .. 1 . | 166 | 20 |
16,759 | public void setNonStrokingColor ( final double g ) throws IOException { if ( _isOutsideOneInterval ( g ) ) { throw new IllegalArgumentException ( "Parameter must be within 0..1, but is " + g ) ; } writeOperand ( ( float ) g ) ; writeOperator ( ( byte ) ' ' ) ; } | Set the non - stroking color in the DeviceGray color space . Range is 0 .. 1 . | 76 | 20 |
16,760 | public void addRect ( final float x , final float y , final float width , final float height ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: addRect is not allowed within a text block." ) ; } writeOperand ( x ) ; writeOperand ( y ) ; writeOperand ( width ) ; writeOperand ( height ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; } | Add a rectangle to the current path . | 100 | 8 |
16,761 | public void moveTo ( final float x , final float y ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: moveTo is not allowed within a text block." ) ; } writeOperand ( x ) ; writeOperand ( y ) ; writeOperator ( ( byte ) ' ' ) ; } | Move the current position to the given coordinates . | 72 | 9 |
16,762 | public void lineTo ( final float x , final float y ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: lineTo is not allowed within a text block." ) ; } writeOperand ( x ) ; writeOperand ( y ) ; writeOperator ( ( byte ) ' ' ) ; } | Draw a line from the current position to the given coordinates . | 72 | 12 |
16,763 | public void shadingFill ( final PDShading shading ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: shadingFill is not allowed within a text block." ) ; } writeOperand ( resources . add ( shading ) ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; } | Fills the clipping area with the given shading . | 74 | 10 |
16,764 | public void setLineJoinStyle ( final int lineJoinStyle ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: setLineJoinStyle is not allowed within a text block." ) ; } if ( lineJoinStyle >= 0 && lineJoinStyle <= 2 ) { writeOperand ( lineJoinStyle ) ; writeOperator ( ( byte ) ' ' ) ; } else { throw new IllegalArgumentException ( "Error: unknown value for line join style" ) ; } } | Set the line join style . | 107 | 6 |
16,765 | public void setLineCapStyle ( final int lineCapStyle ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: setLineCapStyle is not allowed within a text block." ) ; } if ( lineCapStyle >= 0 && lineCapStyle <= 2 ) { writeOperand ( lineCapStyle ) ; writeOperator ( ( byte ) ' ' ) ; } else { throw new IllegalArgumentException ( "Error: unknown value for line cap style" ) ; } } | Set the line cap style . | 107 | 6 |
16,766 | public void setLineDashPattern ( final float [ ] pattern , final float phase ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: setLineDashPattern is not allowed within a text block." ) ; } write ( ( byte ) ' ' ) ; for ( final float value : pattern ) { writeOperand ( value ) ; } write ( ( byte ) ' ' , ( byte ) ' ' ) ; writeOperand ( phase ) ; writeOperator ( ( byte ) ' ' ) ; } | Set the line dash pattern . | 112 | 6 |
16,767 | public void beginMarkedContent ( final COSName tag , final PDPropertyList propertyList ) throws IOException { writeOperand ( tag ) ; writeOperand ( resources . add ( propertyList ) ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' , ( byte ) ' ' ) ; } | Begin a marked content sequence with a reference to an entry in the page resources Properties dictionary . | 68 | 18 |
16,768 | protected void writeOperand ( final float real ) throws IOException { final int byteCount = NumberFormatUtil . formatFloatFast ( real , formatDecimal . getMaximumFractionDigits ( ) , formatBuffer ) ; if ( byteCount == - 1 ) { // Fast formatting failed write ( formatDecimal . format ( real ) ) ; } else { m_aOS . write ( formatBuffer , 0 , byteCount ) ; } m_aOS . write ( ' ' ) ; } | Writes a real real to the content stream . | 104 | 10 |
16,769 | private void writeAffineTransform ( final AffineTransform transform ) throws IOException { final double [ ] values = new double [ 6 ] ; transform . getMatrix ( values ) ; for ( final double v : values ) { writeOperand ( ( float ) v ) ; } } | Writes an AffineTransform to the content stream as an array . | 58 | 14 |
16,770 | public void addPageSet ( @ Nonnull final PLPageSet aPageSet ) { ValueEnforcer . notNull ( aPageSet , "PageSet" ) ; m_aPageSets . add ( aPageSet ) ; } | Add a new page set | 50 | 5 |
16,771 | void setHeaderHeight ( final float fHeaderHeight ) { // Set the maximum value only if ( Float . isNaN ( m_fHeaderHeight ) ) m_fHeaderHeight = fHeaderHeight ; else m_fHeaderHeight = Math . max ( m_fHeaderHeight , fHeaderHeight ) ; } | Set the page header height . | 66 | 6 |
16,772 | void setFooterHeight ( final float fFooterHeight ) { // Set the maximum value only if ( Float . isNaN ( m_fFooterHeight ) ) m_fFooterHeight = fFooterHeight ; else m_fFooterHeight = Math . max ( m_fFooterHeight , fFooterHeight ) ; } | Set the page footer height . The maximum height is used . | 74 | 13 |
16,773 | void addPerPageElements ( @ Nonnull @ Nonempty final ICommonsList < PLElementWithSize > aCurPageElements ) { ValueEnforcer . notEmptyNoNullValue ( aCurPageElements , "CurPageElements" ) ; m_aPerPageElements . add ( aCurPageElements ) ; } | Add a list of elements for a single page . This implicitly creates a new page . | 74 | 17 |
16,774 | @ Nonnegative public float getEffectiveValue ( final float fAvailableWidth ) { switch ( m_eType ) { case ABSOLUTE : return Math . min ( m_fValue , fAvailableWidth ) ; case PERCENTAGE : return fAvailableWidth * m_fValue / 100 ; default : throw new IllegalStateException ( "Unsupported: " + m_eType + " - must be calculated outside!" ) ; } } | Get the effective width based on the passed available width . This may not be called for star or auto width elements . | 91 | 23 |
16,775 | @ Deprecated public ArrayList < Item > getAllItems ( EpcFormat epcFormat , String epcPrefix , String jobId , String zoneNames , PresenceConfidence presenceConfidence , String facility , String pageMarker ) { return getAllItems ( epcFormat , epcPrefix , jobId , zoneNames , presenceConfidence , facility , null , null ) ; } | without this parameter | 82 | 3 |
16,776 | static String getServerIdFromHandshake ( ChannelBuffer handshakeBuffer , ObjectMapper mapper ) throws IOException { Handshake handshake = getHandshakeFromBuffer ( handshakeBuffer , mapper ) ; return handshake . getServerId ( ) ; } | Extract the unique id of the Raft server that sent a handshake message from its wire representation . | 51 | 20 |
16,777 | public void setTitle ( CharSequence title ) { if ( mConstruct != null && ! mConstruct . getDesign ( ) . isMaterial ( ) ) { // Modify the dialog's title element getDialog ( ) . setTitle ( title ) ; } else { if ( mTitle != null ) { mTitle . setText ( title ) ; } } } | Modify the title of the dialog no matter what style it is | 75 | 13 |
16,778 | public void setMessage ( CharSequence message ) { if ( mConstruct != null && ! mConstruct . getDesign ( ) . isMaterial ( ) ) { TextView msgView = ( TextView ) getDialog ( ) . findViewById ( R . id . message ) ; msgView . setText ( message ) ; } else { if ( mMessage != null ) { mMessage . setText ( message ) ; } } } | Modify the message of the dialog | 90 | 7 |
16,779 | private Integer getButtonPriority ( Integer button ) { switch ( button ) { case Dialog . BUTTON_POSITIVE : return 1 ; case Dialog . BUTTON_NEUTRAL : return 2 ; case Dialog . BUTTON_NEGATIVE : return 3 ; default : return 0 ; } } | Get the proper button sorting priority | 65 | 6 |
16,780 | @ Override public void applyDesign ( Design design , int themeColor ) { Context ctx = mInputField . getContext ( ) ; int smallPadId = design . isMaterial ( ) ? R . dimen . default_margin : R . dimen . default_margin_small ; int largePadId = design . isMaterial ( ) ? R . dimen . material_edittext_spacing : R . dimen . default_margin_small ; int padLR = ctx . getResources ( ) . getDimensionPixelSize ( largePadId ) ; int padTB = ctx . getResources ( ) . getDimensionPixelSize ( smallPadId ) ; FrameLayout . LayoutParams params = new FrameLayout . LayoutParams ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . WRAP_CONTENT ) ; params . setMargins ( padLR , padTB , padLR , padTB ) ; mInputField . setLayoutParams ( params ) ; if ( design . isLight ( ) ) mInputField . setTextColor ( mInputField . getResources ( ) . getColor ( R . color . background_material_dark ) ) ; else mInputField . setTextColor ( mInputField . getResources ( ) . getColor ( R . color . background_material_light ) ) ; Drawable drawable ; if ( design . isMaterial ( ) ) { drawable = mInputField . getResources ( ) . getDrawable ( R . drawable . edittext_mtrl_alpha ) ; } else { drawable = mInputField . getBackground ( ) ; } drawable . setColorFilter ( themeColor , PorterDuff . Mode . SRC_ATOP ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) mInputField . setBackground ( drawable ) ; else mInputField . setBackgroundDrawable ( drawable ) ; } | Apply a design to the style | 428 | 6 |
16,781 | @ Override public void onButtonClicked ( int which , DialogInterface dialogInterface ) { switch ( which ) { case Dialog . BUTTON_POSITIVE : if ( mListener != null ) mListener . onAccepted ( getText ( ) ) ; break ; case Dialog . BUTTON_NEGATIVE : // Do nothing for the negative click break ; } } | Called when one of the three available buttons are clicked so that this style can perform a special action such as calling a content delivery callback . | 80 | 28 |
16,782 | synchronized KeyValue get ( long index , String key ) throws KayVeeException { incrementLastAppliedIndex ( index ) ; String value = entries . get ( key ) ; if ( value == null ) { throw new KeyNotFoundException ( key ) ; } return new KeyValue ( key , value ) ; } | Get the value for a key . | 67 | 7 |
16,783 | synchronized KeyValue set ( long index , String key , String value ) { incrementLastAppliedIndex ( index ) ; entries . put ( key , value ) ; return new KeyValue ( key , entries . get ( key ) ) ; } | Set a key to a value . | 51 | 7 |
16,784 | private static void applyDefaults ( Delivery . Builder builder ) { Stamp defaults = getPostman ( ) . defaultStamp ; if ( defaults != null ) { builder . setDesign ( defaults . getDesign ( ) ) . setCancelable ( defaults . isCancelable ( ) ) . setCanceledOnTouchOutside ( defaults . isCanceledOnTouchOutside ( ) ) . setIcon ( defaults . getIcon ( ) ) . setThemeColor ( defaults . getThemeColor ( ) ) . showKeyboardOnDisplay ( defaults . isShowKeyboardOnDisplay ( ) ) ; } } | If possible apply the default stamp to this outgoing delivery | 126 | 10 |
16,785 | private void init ( ) { MAX_BUTTON_WIDTH = TypedValue . applyDimension ( TypedValue . COMPLEX_UNIT_DIP , 124f , getResources ( ) . getDisplayMetrics ( ) ) ; MIN_BUTTON_WIDTH = TypedValue . applyDimension ( TypedValue . COMPLEX_UNIT_DIP , 88f , getResources ( ) . getDisplayMetrics ( ) ) ; } | Initialize the view | 99 | 4 |
16,786 | public void updateDesign ( Design design ) { mDesign = design ; if ( mStyle != null ) mStyle . applyDesign ( mDesign , mThemeColor ) ; } | Update the design of this delivery | 36 | 6 |
16,787 | @ Override public void applyDesign ( Design design , int themeColor ) { if ( mProgressStyle == HORIZONTAL ) { LayerDrawable drawable = ( LayerDrawable ) mLayout . getResources ( ) . getDrawable ( R . drawable . progress_material_horizontal ) ; Drawable bg = drawable . getDrawable ( 0 ) ; int color = design . isLight ( ) ? R . color . grey_700 : R . color . grey_500 ; bg . setColorFilter ( mLayout . getResources ( ) . getColor ( color ) , PorterDuff . Mode . SRC_ATOP ) ; Drawable secProg = drawable . getDrawable ( 1 ) ; secProg . setColorFilter ( lighten ( themeColor ) , PorterDuff . Mode . SRC_ATOP ) ; Drawable prg = drawable . getDrawable ( 2 ) ; prg . setColorFilter ( themeColor , PorterDuff . Mode . SRC_ATOP ) ; mProgress . setProgressDrawable ( drawable ) ; // Style the indeterminate drawable color Drawable animDrawable = mProgress . getIndeterminateDrawable ( ) ; animDrawable . setColorFilter ( themeColor , PorterDuff . Mode . SRC_ATOP ) ; } if ( design . isLight ( ) ) { mProgressText . setTextColor ( mLayout . getResources ( ) . getColor ( R . color . tertiary_text_material_light ) ) ; mProgressMax . setTextColor ( mLayout . getResources ( ) . getColor ( R . color . tertiary_text_material_light ) ) ; } else { mProgressText . setTextColor ( mLayout . getResources ( ) . getColor ( R . color . tertiary_text_material_dark ) ) ; mProgressMax . setTextColor ( mLayout . getResources ( ) . getColor ( R . color . tertiary_text_material_dark ) ) ; } if ( design . isMaterial ( ) ) { FontLoader . applyTypeface ( mProgressText , Types . ROBOTO_MEDIUM ) ; FontLoader . applyTypeface ( mProgressMax , Types . ROBOTO_MEDIUM ) ; } // Style the progress message if available TextView progressMessage = ( TextView ) mLayout . findViewById ( R . id . progress_mesage ) ; if ( progressMessage != null ) { if ( design . isMaterial ( ) ) { LinearLayout progressContainer = ( LinearLayout ) mLayout . findViewById ( R . id . progress_container ) ; progressContainer . removeView ( progressMessage ) ; LinearLayout . LayoutParams params = ( LinearLayout . LayoutParams ) progressMessage . getLayoutParams ( ) ; CharSequence text = progressMessage . getText ( ) ; if ( design . isLight ( ) ) { progressMessage = new TextView ( mCtx , null , R . style . Widget_PostOffice_Material_Light_Dialog_Message ) ; } else { progressMessage = new TextView ( mCtx , null , R . style . Widget_PostOffice_Material_Dark_Dialog_Message ) ; } // Re Update progressMessage . setText ( text ) ; // Set the roboto font FontLoader . applyTypeface ( progressMessage , Types . ROBOTO_REGULAR ) ; // Add it back to the layout progressContainer . addView ( progressMessage , params ) ; } } } | Apply the design of a delivery to this style | 744 | 9 |
16,788 | public ProgressStyle setProgress ( int value ) { if ( mProgressStyle == HORIZONTAL ) { if ( mProgress . isIndeterminate ( ) ) mProgress . setIndeterminate ( false ) ; if ( mProgress . getMax ( ) <= value ) mProgress . setMax ( value ) ; mProgress . setProgress ( value ) ; if ( ! mIsPercentageMode ) { mProgressText . setText ( String . format ( "%d %s" , value , mSuffix ) ) ; } else { mProgressText . setVisibility ( View . GONE ) ; int progress = mProgress . getProgress ( ) ; int max = mProgress . getMax ( ) ; float percent = ( ( float ) progress / ( float ) max ) ; int percentNorm = ( int ) ( percent * 100 ) ; mProgressMax . setText ( String . format ( "%d %%" , percentNorm ) ) ; } if ( value >= mProgress . getMax ( ) && mIsCloseOnFinish && mDialogInterface != null ) { new Handler ( ) . postDelayed ( new Runnable ( ) { @ Override public void run ( ) { mDialogInterface . dismiss ( ) ; } } , 300 ) ; } } return this ; } | Set the progress of the progress bar | 270 | 7 |
16,789 | public ProgressStyle setMax ( int value ) { if ( mProgressStyle == HORIZONTAL ) { if ( mProgress . isIndeterminate ( ) ) mProgress . setIndeterminate ( false ) ; mProgress . setMax ( value ) ; if ( ! mIsPercentageMode ) mProgressMax . setText ( String . format ( "%d %s" , value , mSuffix ) ) ; } return this ; } | Set the max total progress of the progress bar | 94 | 9 |
16,790 | public ProgressStyle setIndeterminate ( boolean value ) { if ( mProgressStyle == HORIZONTAL ) { mProgress . setIndeterminate ( value ) ; mProgressText . setVisibility ( value ? View . GONE : View . VISIBLE ) ; mProgressMax . setVisibility ( value ? View . GONE : View . VISIBLE ) ; } return this ; } | Set this progress as Indeterminate | 82 | 7 |
16,791 | private int lighten ( int color ) { float [ ] hsv = new float [ 3 ] ; Color . colorToHSV ( color , hsv ) ; hsv [ 2 ] = 1.0f - 0.8f * ( 1.0f - hsv [ 2 ] ) ; color = Color . HSVToColor ( hsv ) ; return color ; } | Get a lighter color for a given color | 80 | 8 |
16,792 | @ Deprecated public ItemHistoryResponse getItemHistory ( EpcFormat epcFormat , String epcPrefix , String jobId , String fromZone , String toZone , String fromFacility , String toFacility , PresenceConfidence presenceConfidence , String facility , Integer pageSize , String pageMarker ) { return getItemHistory ( epcFormat , epcPrefix , jobId , fromZone , toZone , fromFacility , toFacility , null , null , null , null , pageSize , pageMarker , null ) ; } | This is deprecated because the parameters do not correspond to the itemsense parameters | 116 | 14 |
16,793 | @ Deprecated public ArrayList < ItemHistory > getAllItemHistory ( EpcFormat epcFormat , String epcPrefix , String jobId , String fromZone , String toZone , String fromFacility , String toFacility , PresenceConfidence presenceConfidence , String facility , String pageMarker ) { ItemHistoryResponse response ; String nextPageMarker = "" ; int pageSize = 1000 ; ArrayList < ItemHistory > items = new ArrayList <> ( ) ; do { response = this . getItemHistory ( epcFormat , epcPrefix , jobId , fromZone , toZone , fromFacility , toFacility , presenceConfidence , facility , pageSize , nextPageMarker ) ; if ( response . getHistory ( ) != null ) { Collections . addAll ( items , response . getHistory ( ) ) ; } nextPageMarker = response . getNextPageMarker ( ) ; } while ( nextPageMarker != null && ! nextPageMarker . isEmpty ( ) ) ; return items ; } | and page marker is redundant | 221 | 5 |
16,794 | @ Override public int propertyNameToCType ( byte [ ] bytes , int p , int end ) { Integer ctype = PosixBracket . PBSTableUpper . get ( bytes , p , end ) ; if ( ctype != null ) return ctype ; throw new CharacterPropertyException ( EncodingError . ERR_INVALID_CHAR_PROPERTY_NAME , bytes , p , end - p ) ; } | onigenc_minimum_property_name_to_ctype notably overridden by unicode encodings | 93 | 23 |
16,795 | static byte [ ] asciiCompatibleEncoding ( byte [ ] asciiCompatName ) { CaseInsensitiveBytesHash < TranscoderDB . Entry > dTable = TranscoderDB . transcoders . get ( asciiCompatName ) ; if ( dTable == null || dTable . size ( ) != 1 ) return null ; byte [ ] asciiCN = null ; for ( Entry e : dTable ) { if ( ! EConv . decorator ( e . source , e . destination ) ) { Transcoder transcoder = e . getTranscoder ( ) ; if ( transcoder != null && transcoder . compatibility . isDecoder ( ) ) { asciiCN = transcoder . destination ; break ; } } } return asciiCN ; } | ?? to transcoderdb ? | 170 | 6 |
16,796 | protected final void checkResize ( ) { if ( size == table . length ) { // size / table.length > DENSITY int forSize = table . length + 1 ; // size + 1; for ( int i = 0 , newCapacity = MIN_CAPA ; i < PRIMES . length ; i ++ , newCapacity <<= 1 ) { if ( newCapacity > forSize ) { resize ( PRIMES [ i ] ) ; return ; } } return ; } } | private static final int DENSITY = 5 ; | 106 | 10 |
16,797 | public void insert ( Envelope itemEnv , Object item ) { if ( itemEnv . isNull ( ) ) { return ; } super . insert ( itemEnv , item ) ; } | Inserts an item having the given bounds into the tree . | 42 | 12 |
16,798 | public double calculateSuperficialDischarge ( double superficialDischarge , double saturatedAreaPercentage , long timeInMillis ) { distributeIncomingSuperficialDischarge ( superficialDischarge , saturatedAreaPercentage , timeInMillis ) ; return superficialDischargeArray [ indexFromTimeInMillis ( timeInMillis ) ] ; } | Calculates the current superficial discharge . | 72 | 8 |
16,799 | public double calculateSubsuperficialDischarge ( double subSuperficialDischarge , double saturatedAreaPercentage , long timeInMillis ) { distributeIncomingSubSuperficialDischarge ( subSuperficialDischarge , saturatedAreaPercentage , timeInMillis ) ; return subSuperficialDischargeArray [ indexFromTimeInMillis ( timeInMillis ) ] ; } | Calculates the current subsuperficial discharge . | 83 | 11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.