idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
139,000
private void unwrapIO ( RedmineException orig , String tag ) throws IOException { Throwable e = orig ; while ( e != null ) { if ( e instanceof MarkedIOException ) { final MarkedIOException marked = ( MarkedIOException ) e ; if ( tag . equals ( marked . getTag ( ) ) ) throw marked . getIOException ( ) ; } e = e . getCau...
Unwraps an IO .
139,001
public void addMembership ( Membership membership ) throws RedmineException { final Project project = membership . getProject ( ) ; if ( project == null ) throw new IllegalArgumentException ( "Project must be set" ) ; if ( membership . getUser ( ) == null ) throw new IllegalArgumentException ( "User must be set" ) ; tr...
Add a membership .
139,002
public void export ( Writer output , UndirectedGraph < V , E > g ) { export ( output , g , false ) ; }
Exports an undirected graph into a PLAIN text file in GML format .
139,003
public void export ( Writer output , DirectedGraph < V , E > g ) { export ( output , g , true ) ; }
Exports a directed graph into a PLAIN text file in GML format .
139,004
public void set ( final Iterable < String > strings ) { checkNotNull ( strings ) ; candidates . clear ( ) ; addAll ( strings ) ; }
Set completion strings ; replacing any existing .
139,005
public void addAll ( final Iterable < String > strings ) { checkNotNull ( strings ) ; for ( String string : strings ) { add ( string ) ; } }
Add all strings to existing candidates .
139,006
public void add ( final String string ) { checkNotNull ( string ) ; candidates . put ( string , candidate ( string ) ) ; }
Add a string to existing candidates .
139,007
public void add ( final String string , final Candidate candidate ) { checkNotNull ( string ) ; checkNotNull ( candidate ) ; candidates . put ( string , candidate ) ; }
Add string with specific completer .
139,008
protected void initNextPath ( long initStamp , long tickStamp ) { if ( _paths . size ( ) == 0 ) { _pable . pathCompleted ( tickStamp ) ; } else { _curPath = _paths . remove ( 0 ) ; _lastInit = initStamp ; _curPath . init ( _pableRep , initStamp ) ; _curPath . tick ( _pableRep , tickStamp ) ; } }
Initialize and start the next path in the sequence .
139,009
public static String getStatus ( String elementName , long percentage , double speed , String speedUnit , Duration eta ) { StringBuilder sb = new StringBuilder ( getBar ( percentage ) ) ; sb . append ( ( long ) speed ) ; if ( elementName != null ) { sb . append ( " " ) . append ( elementName ) ; } sb . append ( "/" ) ....
Generate the full status .
139,010
protected static String getBar ( long percentage ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( percentage ) ; sb . append ( "% [" ) ; for ( int i = 0 ; i < 100 ; i ++ ) { if ( percentage == 100 || i < percentage - 1 ) { sb . append ( "=" ) ; } else if ( i == percentage - 1 ) { sb . append ( ">" ) ; } els...
Generates the progress bar for the given percentage
139,011
public void processConnect ( WebSocketChannel channel , WSURI location , String [ ] protocols ) { nextHandler . processConnect ( channel , location , protocols ) ; }
Process connect request to uri and protocol specified
139,012
public synchronized void processAuthorize ( WebSocketChannel channel , String authorizeToken ) { nextHandler . processAuthorize ( channel , authorizeToken ) ; }
Send authorize token to the Gateway
139,013
public tsfile_data data ( TimeSeriesCollection ts_data ) { final dictionary_delta dict_delta = new dictionary_delta ( ) ; dict_delta . gdd = new path_dictionary_delta [ 0 ] ; dict_delta . mdd = new path_dictionary_delta [ 0 ] ; dict_delta . sdd = new strval_dictionary_delta [ 0 ] ; dict_delta . tdd = new tag_dictionary...
Transform a TimeSeriesCollection into the XDR serialized form .
139,014
public static < T > Iterable < T > simpleIterable ( final Iterable < T > iterable ) { requireNonNull ( iterable ) ; return ( ) -> iterable . iterator ( ) ; }
Wraps any iterable into a generic iterable object . This is useful for using complex iterables such as FluentIterable with libraries that use reflection to determine bean definitions such as Jackson .
139,015
public static < T > Iterable < T > distinct ( final Iterable < T > iterable ) { requireNonNull ( iterable ) ; return ( ) -> Iterators2 . distinct ( iterable . iterator ( ) ) ; }
If we can assume the iterable is sorted return the distinct elements . This only works if the data provided is sorted .
139,016
public String encodeAuthAmqPlain ( String username , String password ) { AmqpBuffer bytes = new AmqpBuffer ( ) ; bytes . putShortString ( "LOGIN" ) ; bytes . putTypeIdentifier ( "Longstr" ) ; bytes . putLongString ( username ) ; bytes . putShortString ( "PASSWORD" ) ; bytes . putTypeIdentifier ( "Longstr" ) ; bytes . p...
Encodes the AMQPLAIN authentication response as an AmqpArguments
139,017
private Arg [ ] getMethodArguments ( List < Parameter > param ) { Arg [ ] val = new Arg [ param . size ( ) ] ; for ( int i = 0 ; i < param . size ( ) ; i ++ ) { String type = param . get ( i ) . type ; Arg arg = new Arg ( ) ; arg . type = type ; arg . name = param . get ( i ) . name ; Object v = null ; String type1 = n...
Decodes arguments given a method s parameter list
139,018
public AmqpFrame getFrame ( ) { int pos = this . position ( ) ; AmqpMethod method = new AmqpMethod ( ) ; int classIndex ; AmqpFrame frame = new AmqpFrame ( ) ; if ( this . remaining ( ) > 7 ) { frame . setHeader ( this . getFrameHeader ( ) ) ; frame . setChannelId ( ( short ) frame . getHeader ( ) . channel ) ; frame ....
Parses the ByteBuffer and returns an AMQP frame
139,019
AmqpBuffer putMethodArguments ( Object [ ] args , List < Parameter > formalParams ) { for ( int i = 0 ; i < formalParams . size ( ) ; i ++ ) { String type = formalParams . get ( i ) . type ; if ( type == null ) { throw new IllegalStateException ( "Unknown AMQP domain " + type ) ; } String typeMap = getMappedType ( type...
Encodes arguments given a method s parameter list and the provided arguments
139,020
public void update ( Graphics g ) { Shape clip = g . getClip ( ) ; Rectangle dirty ; if ( clip != null ) { dirty = clip . getBounds ( ) ; } else { dirty = getRootPane ( ) . getBounds ( ) ; Insets insets = getInsets ( ) ; dirty . x += insets . left ; dirty . y += insets . top ; } if ( _fmgr != null ) { _fmgr . restoreFr...
We catch update requests and forward them on to the repaint infrastructure .
139,021
public static < T extends Serializable > T deserialize ( byte [ ] bytes ) throws IOException , ClassNotFoundException { return deserialize ( bytes , false ) ; }
Utility for returning a Serializable object from a byte array .
139,022
public PushProcessorPipeline build ( List < PushProcessorSupplier > processor_suppliers ) throws Exception { ApiServer api = null ; PushMetricRegistryInstance registry = null ; final List < PushProcessor > processors = new ArrayList < > ( processor_suppliers . size ( ) ) ; try { final EndpointRegistration epr ; if ( ep...
Creates a push processor .
139,023
public static BufferedImage createCompatibleImage ( BufferedImage source , int width , int height ) { WritableRaster raster = source . getRaster ( ) . createCompatibleWritableRaster ( width , height ) ; return new BufferedImage ( source . getColorModel ( ) , raster , false , null ) ; }
Creates a new buffered image with the same sample model and color model as the source image but with the new width and height .
139,024
public static BufferedImage createErrorImage ( int width , int height ) { BufferedImage img = new BufferedImage ( width , height , BufferedImage . TYPE_BYTE_INDEXED ) ; Graphics2D g = ( Graphics2D ) img . getGraphics ( ) ; g . setColor ( Color . red ) ; Label l = new Label ( "Error" ) ; l . layout ( g ) ; Dimension d =...
Creates an image with the word Error written in it .
139,025
public static BufferedImage recolorImage ( BufferedImage image , Colorization [ ] zations ) { ColorModel cm = image . getColorModel ( ) ; if ( ! ( cm instanceof IndexColorModel ) ) { throw new RuntimeException ( Logger . format ( "Unable to recolor images with non-index color model" , "cm" , cm . getClass ( ) ) ) ; } I...
Recolors the supplied image using the supplied colorizations .
139,026
public static void tileImage ( Graphics2D gfx , Mirage image , int x , int y , int width , int height ) { int iwidth = image . getWidth ( ) , iheight = image . getHeight ( ) ; int xnum = width / iwidth , xplus = width % iwidth ; int ynum = height / iheight , yplus = height % iheight ; Shape oclip = gfx . getClip ( ) ; ...
Paints multiple copies of the supplied image using the supplied graphics context such that the requested area is filled with the image .
139,027
public static void tileImageAcross ( Graphics2D gfx , Mirage image , int x , int y , int width ) { tileImage ( gfx , image , x , y , width , image . getHeight ( ) ) ; }
Paints multiple copies of the supplied image using the supplied graphics context such that the requested width is filled with the image .
139,028
public static void tileImageDown ( Graphics2D gfx , Mirage image , int x , int y , int height ) { tileImage ( gfx , image , x , y , image . getWidth ( ) , height ) ; }
Paints multiple copies of the supplied image using the supplied graphics context such that the requested height is filled with the image .
139,029
public static BufferedImage createTracedImage ( ImageCreator isrc , BufferedImage src , Color tcolor , int thickness ) { return createTracedImage ( isrc , src , tcolor , thickness , 1.0f , 1.0f ) ; }
Creates and returns a new image consisting of the supplied image traced with the given color and thickness .
139,030
protected static boolean bordersNonTransparentPixel ( BufferedImage data , int wid , int hei , boolean [ ] traced , int x , int y ) { if ( y > 0 ) { for ( int rxx = x - 1 ; rxx <= x + 1 ; rxx ++ ) { if ( rxx < 0 || rxx >= wid || traced [ ( ( y - 1 ) * wid ) + rxx ] ) { continue ; } if ( ( data . getRGB ( rxx , y - 1 ) ...
Returns whether the given pixel is bordered by any non - transparent pixel .
139,031
public static BufferedImage composeMaskedImage ( ImageCreator isrc , BufferedImage mask , BufferedImage base ) { int wid = base . getWidth ( ) ; int hei = base . getHeight ( ) ; Raster maskdata = mask . getData ( ) ; Raster basedata = base . getData ( ) ; if ( maskdata . getNumBands ( ) == 4 && basedata . getNumBands (...
Create an image using the alpha channel from the first and the RGB values from the second .
139,032
public static BufferedImage composeMaskedImage ( ImageCreator isrc , Shape mask , BufferedImage base ) { int wid = base . getWidth ( ) ; int hei = base . getHeight ( ) ; BufferedImage target = isrc . createImage ( wid , hei , Transparency . TRANSLUCENT ) ; Graphics2D g2 = target . createGraphics ( ) ; try { g2 . setCol...
Create a new image using the supplied shape as a mask from which to cut out pixels from the supplied image . Pixels inside the shape will be added to the final image pixels outside the shape will be clear .
139,033
public static void computeTrimmedBounds ( BufferedImage image , Rectangle tbounds ) { int width = image . getWidth ( ) , height = image . getHeight ( ) ; int firstrow = - 1 , lastrow = - 1 , minx = width , maxx = 0 ; for ( int yy = 0 ; yy < height ; yy ++ ) { int firstidx = - 1 , lastidx = - 1 ; for ( int xx = 0 ; xx <...
Computes the bounds of the smallest rectangle that contains all non - transparent pixels of this image . This isn t extremely efficient so you shouldn t be doing this anywhere exciting .
139,034
public static long getEstimatedMemoryUsage ( Raster raster ) { DataBuffer db = raster . getDataBuffer ( ) ; int bpe = ( int ) Math . ceil ( DataBuffer . getDataTypeSize ( db . getDataType ( ) ) / 8f ) ; return bpe * db . getSize ( ) ; }
Returns the estimated memory usage in bytes for the specified raster .
139,035
public static long getEstimatedMemoryUsage ( Iterator < BufferedImage > iter ) { long size = 0 ; while ( iter . hasNext ( ) ) { BufferedImage image = iter . next ( ) ; size += getEstimatedMemoryUsage ( image ) ; } return size ; }
Returns the estimated memory usage in bytes for all buffered images in the supplied iterator .
139,036
protected static GraphicsConfiguration getDefGC ( ) { if ( _gc == null ) { try { GraphicsEnvironment env = GraphicsEnvironment . getLocalGraphicsEnvironment ( ) ; GraphicsDevice gd = env . getDefaultScreenDevice ( ) ; _gc = gd . getDefaultConfiguration ( ) ; } catch ( HeadlessException e ) { } } return _gc ; }
Obtains the default graphics configuration for this VM . If the JVM is in headless mode this method will return null .
139,037
public void getIntersectingSprites ( List < Sprite > list , Shape shape ) { int size = _sprites . size ( ) ; for ( int ii = 0 ; ii < size ; ii ++ ) { Sprite sprite = _sprites . get ( ii ) ; if ( sprite . intersects ( shape ) ) { list . add ( sprite ) ; } } }
When an animated view processes its dirty rectangles it may require an expansion of the dirty region which may in turn require the invalidation of more sprites than were originally invalid . In such cases the animated view can call back to the sprite manager asking it to append the sprites that intersect a particular r...
139,038
public void getHitSprites ( List < Sprite > list , int x , int y ) { for ( int ii = _sprites . size ( ) - 1 ; ii >= 0 ; ii -- ) { Sprite sprite = _sprites . get ( ii ) ; if ( sprite . hitTest ( x , y ) ) { list . add ( sprite ) ; } } }
When an animated view is determining what entity in its view is under the mouse pointer it may require a list of sprites that are hit by a particular pixel . The sprites bounds are first checked and sprites with bounds that contain the supplied point are further checked for a non - transparent at the specified location...
139,039
public Sprite getHighestHitSprite ( int x , int y ) { for ( int ii = _sprites . size ( ) - 1 ; ii >= 0 ; ii -- ) { Sprite sprite = _sprites . get ( ii ) ; if ( sprite . hitTest ( x , y ) ) { return sprite ; } } return null ; }
Finds the sprite with the highest render order that hits the specified pixel .
139,040
public void removeSprites ( Predicate < Sprite > pred ) { int idxoff = 0 ; for ( int ii = 0 , ll = _sprites . size ( ) ; ii < ll ; ii ++ ) { Sprite sprite = _sprites . get ( ii - idxoff ) ; if ( pred . apply ( sprite ) ) { _sprites . remove ( sprite ) ; sprite . invalidate ( ) ; sprite . shutdown ( ) ; idxoff ++ ; if (...
Removes all sprites that match the supplied predicate .
139,041
public void cancelMove ( ) { if ( _path != null ) { Path oldpath = _path ; _path = null ; oldpath . wasRemoved ( this ) ; if ( _observers != null ) { _observers . apply ( new CancelledOp ( this , oldpath ) ) ; } } }
Cancels any path that the sprite may currently be moving along .
139,042
public void pathCompleted ( long timestamp ) { Path oldpath = _path ; _path = null ; oldpath . wasRemoved ( this ) ; if ( _observers != null ) { _observers . apply ( new CompletedOp ( this , oldpath , timestamp ) ) ; } }
Called by the active path when it has completed .
139,043
protected boolean tickPath ( long tickStamp ) { if ( _path == null ) { return false ; } if ( _pathStamp == 0 ) { _path . init ( this , _pathStamp = tickStamp ) ; } return ( _path == null ) ? true : _path . tick ( this , tickStamp ) ; }
Ticks any path assigned to this sprite .
139,044
public void layout ( Graphics2D gfx , SceneObject tipFor , Rectangle boundary ) { layout ( gfx , ICON_PAD , EXTRA_PAD ) ; bounds = new Rectangle ( _size ) ; for ( int ii = 0 , ll = _layouts . size ( ) ; ii < ll ; ii ++ ) { LayoutReg reg = _layouts . get ( ii ) ; String act = tipFor . info . action == null ? "" : tipFor...
Called to initialize the tip so that it can be painted .
139,045
public static void registerTipLayout ( String prefix , TipLayout layout ) { LayoutReg reg = new LayoutReg ( ) ; reg . prefix = prefix ; reg . layout = layout ; _layouts . insertSorted ( reg ) ; }
It may be desirable to layout object tips specially depending on what sort of actions they represent so we allow different tip layout algorithms to be registered for particular object prefixes . The registration is simply a list searched from longest string to shortest string for the first match to an object s action .
139,046
public static boolean isLeaf ( Node node ) { return node instanceof Leaf || node . children ( ) == null || node . children ( ) . size ( ) == 0 ; }
Returns true if a node is a leaf . Note that a leaf can also be a parent node that does not have any children .
139,047
public static boolean isEmpty ( Node node ) { return ( node == null || ( node . children ( ) != null && node . children ( ) . size ( ) == 0 ) ) ; }
Determines if a node is null or a single parent node without children .
139,048
public static boolean parentContainsOnlyLeaves ( ParentNode parentNode ) { for ( Node child : parentNode . children ( ) ) { if ( ! isLeaf ( child ) ) return false ; } return true ; }
Determines if parent node has children that are all leaves
139,049
public static Criteria criteriaFromNode ( Node node , Comparator rangeComparator ) { return criteriaFromNode ( node , rangeComparator , null ) ; }
Creates criteria from a node . A Comparator is injected into all nodes which need to determine order or equality .
139,050
public static void renameTileSet ( String mapPath , String oldName , String newName ) throws PersistenceException { MapFileTileSetIDBroker broker = new MapFileTileSetIDBroker ( new File ( mapPath ) ) ; if ( ! broker . renameTileSet ( oldName , newName ) ) { throw new PersistenceException ( "No such old tileset '" + old...
Loads up the tileset map file with the specified path and copies the tileset ID from the old tileset name to the new tileset name . This is necessary when a tileset is renamed so that the new name does not cause the tileset to be assigned a new tileset ID . Bear in mind that the old name should never again be used as i...
139,051
protected TrimmedTileSet trim ( TileSet aset , OutputStream fout ) throws IOException { return TrimmedTileSet . trimTileSet ( aset , fout ) ; }
Converts the tileset to a trimmed tile set and saves it at the specified location .
139,052
protected void saveBroker ( File mapfile , HashMapIDBroker broker ) throws RuntimeException { if ( ! broker . isModified ( ) ) { return ; } try { BufferedWriter bout = new BufferedWriter ( new FileWriter ( mapfile ) ) ; broker . writeTo ( bout ) ; bout . close ( ) ; } catch ( IOException ioe ) { throw new RuntimeExcept...
Stores a persistent representation of the supplied hashmap ID broker in the specified file .
139,053
private static GroupName nameFromObjectName ( ObjectName obj_name , NamedResolverMap resolvedMap ) { String name = obj_name . getKeyProperty ( "name" ) ; String type = obj_name . getKeyProperty ( "type" ) ; String domain = obj_name . getDomain ( ) ; Map < String , MetricValue > tags = obj_name . getKeyPropertyList ( ) ...
Extract a metric group name from a JMX ObjectName .
139,054
static boolean isSorted ( Iterable < ? extends TimeSeriesCollection > tscIterable ) { final Iterator < ? extends TimeSeriesCollection > iter = tscIterable . iterator ( ) ; if ( ! iter . hasNext ( ) ) return true ; DateTime timestamp = iter . next ( ) . getTimestamp ( ) ; while ( iter . hasNext ( ) ) { final DateTime ne...
Validation function to check if an iterable is sorted with ascending timestamps .
139,055
public void resolve ( Observer observer ) { if ( _state == UNLOADING ) { _state = LOADED ; _manager . restoreClip ( this ) ; } if ( _state == LOADED ) { if ( observer != null ) { observer . clipLoaded ( this ) ; } return ; } if ( observer != null ) { _observers . add ( observer ) ; } if ( _state == LOADING ) { return ;...
Instructs this buffer to resolve its underlying clip and be ready to be played ASAP .
139,056
public void dispose ( ) { if ( _buffer != null ) { if ( _bound > 0 ) { _state = UNLOADING ; return ; } _buffer . delete ( ) ; _buffer = null ; _state = UNLOADED ; } }
Frees up the internal audio buffers associated with this clip .
139,057
protected boolean bind ( Clip clip ) { AL10 . alGetError ( ) ; _buffer . setData ( clip . format , clip . data , clip . frequency ) ; int errno = AL10 . alGetError ( ) ; if ( errno != AL10 . AL_NO_ERROR ) { log . warning ( "Failed to bind clip" , "key" , getKey ( ) , "errno" , errno ) ; failed ( ) ; return false ; } _s...
This method is called back on the main thread and instructs this buffer to bind the clip data to this buffer s OpenAL buffer .
139,058
protected void failed ( ) { if ( _buffer != null ) { _buffer . delete ( ) ; _buffer = null ; } _state = UNLOADED ; _observers . apply ( new ObserverList . ObserverOp < Observer > ( ) { public boolean apply ( Observer observer ) { observer . clipFailed ( ClipBuffer . this ) ; return true ; } } ) ; _observers . clear ( )...
Called when we fail in some part of the process in resolving our clip data . Notifies our observers and resets the clip to the UNLOADED state .
139,059
protected void createVolatileImage ( ) { if ( _image != null ) { _image . flush ( ) ; } _image = _imgr . createImage ( _bounds . width , _bounds . height , getTransparency ( ) ) ; refreshVolatileImage ( ) ; }
Creates our volatile image from the information in our source image .
139,060
public boolean askBoolean ( final String question ) { checkNotNull ( question ) ; log . trace ( "Ask boolean; question={}" , question ) ; String result = readLine ( String . format ( "%s (yes/no): " , question ) ) ; return result . equalsIgnoreCase ( "yes" ) ; }
Ask a question which results in a boolean result .
139,061
public void addPressCommand ( int keyCode , String command , int rate ) { addPressCommand ( keyCode , command , rate , DEFAULT_REPEAT_DELAY ) ; }
Adds a mapping from a key press to an action command string that will auto - repeat at the specified repeat rate . Overwrites any existing mapping and repeat rate that may have already been registered .
139,062
public void addPressCommand ( int keyCode , String command , int rate , long repeatDelay ) { KeyRecord krec = getKeyRecord ( keyCode ) ; krec . pressCommand = command ; krec . repeatRate = rate ; krec . repeatDelay = repeatDelay ; }
Adds a mapping from a key press to an action command string that will auto - repeat at the specified repeat rate after the specified auto - repeat delay has expired . Overwrites any existing mapping for the specified key code that may have already been registered .
139,063
public void addReleaseCommand ( int keyCode , String command ) { KeyRecord krec = getKeyRecord ( keyCode ) ; krec . releaseCommand = command ; }
Adds a mapping from a key release to an action command string . Overwrites any existing mapping that may already have been registered .
139,064
protected KeyRecord getKeyRecord ( int keyCode ) { KeyRecord krec = _keys . get ( keyCode ) ; if ( krec == null ) { krec = new KeyRecord ( ) ; _keys . put ( keyCode , krec ) ; } return krec ; }
Returns the key record for the specified key creating it and inserting it in the key table if necessary .
139,065
public void addSprite ( Sprite sprite ) { _metamgr . addSprite ( sprite ) ; if ( ( ( sprite instanceof ActionSprite ) || ( sprite instanceof HoverSprite ) ) && ( _actionSpriteCount ++ == 0 ) ) { if ( _actionHandler == null ) { _actionHandler = createActionSpriteHandler ( ) ; } addMouseListener ( _actionHandler ) ; addM...
Adds a sprite to this panel .
139,066
public void removeSprite ( Sprite sprite ) { _metamgr . removeSprite ( sprite ) ; if ( ( ( sprite instanceof ActionSprite ) || ( sprite instanceof HoverSprite ) ) && ( -- _actionSpriteCount == 0 ) ) { removeMouseListener ( _actionHandler ) ; removeMouseMotionListener ( _actionHandler ) ; } }
Removes a sprite from this panel .
139,067
public void clearSprites ( ) { _metamgr . clearSprites ( ) ; if ( _actionHandler != null ) { removeMouseListener ( _actionHandler ) ; removeMouseMotionListener ( _actionHandler ) ; _actionSpriteCount = 0 ; } }
Removes all sprites from this panel .
139,068
public void tick ( long tickStamp ) { if ( _metamgr . isPaused ( ) ) { return ; } willTick ( tickStamp ) ; _metamgr . tick ( tickStamp ) ; didTick ( tickStamp ) ; _tickPaintPending = true ; }
from interface FrameParticipant
139,069
public void addObscurer ( Obscurer obscurer ) { if ( _obscurerList == null ) { _obscurerList = Lists . newArrayList ( ) ; } _obscurerList . add ( obscurer ) ; }
Adds an element that could be obscuring the panel and thus requires extra redrawing .
139,070
protected void addObscurerDirtyRegions ( boolean changedOnly ) { if ( _obscurerList != null ) { for ( Obscurer obscurer : _obscurerList ) { Rectangle obscured = obscurer . getObscured ( changedOnly ) ; if ( obscured != null ) { Point pt = new Point ( obscured . x , obscured . y ) ; SwingUtilities . convertPointFromScre...
Add dirty regions for all our obscurers .
139,071
protected void paintDirtyRect ( Graphics2D gfx , Rectangle rect ) { paintBehind ( gfx , rect ) ; paintBits ( gfx , AnimationManager . BACK , rect ) ; paintBetween ( gfx , rect ) ; paintBits ( gfx , AnimationManager . FRONT , rect ) ; paintInFront ( gfx , rect ) ; }
Paints all the layers of the specified dirty region .
139,072
public static String getEntityEncoding ( HttpEntity entity ) { final Header header = entity . getContentEncoding ( ) ; if ( header == null ) return null ; return header . getValue ( ) ; }
Returns entity encoding .
139,073
public static String getCharset ( HttpEntity entity ) { final String guess = EntityUtils . getContentCharSet ( entity ) ; return guess == null ? HTTP . DEFAULT_CONTENT_CHARSET : guess ; }
Returns entity charset to use .
139,074
public Tuple < String , Boolean > decodeFormat ( int type , String format ) { boolean quotes = true ; switch ( placeOf ( type ) ) { case PLACE : switch ( modeOf ( type ) ) { case EMOTE : quotes = false ; break ; } break ; } return Tuple . newTuple ( format , quotes ) ; }
Determines the format string and whether to use quotes based on the chat type .
139,075
public int decodeType ( String localtype ) { if ( ChatCodes . USER_CHAT_TYPE . equals ( localtype ) ) { return TELL ; } else if ( ChatCodes . PLACE_CHAT_TYPE . equals ( localtype ) ) { return PLACE ; } else { return 0 ; } }
Decodes the main chat type given the supplied localtype provided by the chat system .
139,076
public int adjustTypeByMode ( int mode , int type ) { switch ( mode ) { case ChatCodes . DEFAULT_MODE : return type | SPEAK ; case ChatCodes . EMOTE_MODE : return type | EMOTE ; case ChatCodes . THINK_MODE : return type | THINK ; case ChatCodes . SHOUT_MODE : return type | SHOUT ; case ChatCodes . BROADCAST_MODE : retu...
Adjust the chat type based on the mode of the chat message .
139,077
public Color getOutlineColor ( int type ) { switch ( type ) { case BROADCAST : return BROADCAST_COLOR ; case TELL : return TELL_COLOR ; case TELLFEEDBACK : return TELLFEEDBACK_COLOR ; case INFO : return INFO_COLOR ; case FEEDBACK : return FEEDBACK_COLOR ; case ATTENTION : return ATTENTION_COLOR ; default : return Color...
Computes the chat glyph outline color from the chat message type .
139,078
public SparseMisoSceneModel parseScene ( String path ) throws IOException , SAXException { _model = null ; _digester . push ( this ) ; FileInputStream stream = null ; try { stream = new FileInputStream ( path ) ; _digester . parse ( stream ) ; } finally { StreamUtil . close ( stream ) ; } return _model ; }
Parses the XML file at the specified path into a scene model instance .
139,079
public static PathMatcher valueOf ( String str ) throws ParseException { try { return valueOf ( new StringReader ( str ) ) ; } catch ( IOException ex ) { throw new IllegalStateException ( "StringReader IO error?" , ex ) ; } }
Read path matcher from string .
139,080
public static PathMatcher valueOf ( Reader reader ) throws IOException , ParseException { class DescriptiveErrorListener extends BaseErrorListener { public List < String > errors = new ArrayList < > ( ) ; public void syntaxError ( Recognizer < ? , ? > recognizer , Object offendingSymbol , int line , int charPositionInL...
Read path matcher from reader .
139,081
public List < ChannelListener > getChannelListeners ( ) { if ( changes == null ) { return ( List < ChannelListener > ) Collections . EMPTY_LIST ; } List < EventListener > listeners = changes . getListenerList ( AMQP ) ; if ( ( listeners == null ) || listeners . isEmpty ( ) ) { return ( List < ChannelListener > ) Collec...
Returns the list of ChannelListeners registered with this AmqpChannel instance .
139,082
AmqpChannel openChannel ( ) { if ( readyState == ReadyState . OPEN ) { return this ; } Object [ ] args = { "" } ; WrappedByteBuffer bodyArg = null ; HashMap < String , Object > headersArg = null ; String methodName = "openChannel" ; String methodId = "20" + "10" ; AmqpMethod amqpMethod = MethodLookup . LookupMethod ( m...
Creates a Channel to the AMQP server on the given clients connection
139,083
public AmqpChannel flowChannel ( boolean active ) { isFlowOn = active ; Object [ ] args = { active } ; WrappedByteBuffer bodyArg = null ; HashMap < String , Object > headersArg = null ; String methodId = "20" + "20" ; String methodName = "flowChannel" ; AmqpMethod amqpMethod = MethodLookup . LookupMethod ( methodId ) ;...
This method asks the peer to pause or restart the flow of content data sent by a consumer . This is a simple flow - control mechanism that a peer can use to avoid overflowing its queues or otherwise finding itself receiving more messages than it can process .
139,084
public AmqpChannel closeChannel ( int replyCode , String replyText , int classId , int methodId1 ) { if ( readyState == ReadyState . CLOSED ) { return this ; } Object [ ] args = { replyCode , replyText , classId , methodId1 } ; WrappedByteBuffer bodyArg = null ; HashMap < String , Object > headersArg = null ; String me...
This method indicates that the sender wants to close the channel .
139,085
private AmqpChannel closeOkChannel ( ) { if ( readyState == ReadyState . CLOSED ) { return this ; } Object [ ] args = { } ; WrappedByteBuffer bodyArg = null ; HashMap < String , Object > headersArg = null ; String methodName = "closeOkChannel" ; String methodId = "20" + "41" ; AmqpMethod amqpMethod = MethodLookup . Loo...
Confirms to the peer that a flow command was received and processed .
139,086
public AmqpChannel deleteQueue ( String queue , boolean ifUnused , boolean ifEmpty , boolean noWait ) { Object [ ] args = { 0 , queue , ifUnused , ifEmpty , noWait } ; WrappedByteBuffer bodyArg = null ; HashMap < String , Object > headersArg = null ; String methodName = "deleteQueue" ; String methodId = "50" + "40" ; A...
This method deletes a queue . When a queue is deleted any pending messages are sent to a dead - letter queue if this is defined in the server configuration and all consumers on the queue are canceled .
139,087
public AmqpChannel unbindQueue ( String queue , String exchange , String routingKey , AmqpArguments arguments ) { Object [ ] args = { 0 , queue , exchange , routingKey , arguments } ; WrappedByteBuffer bodyArg = null ; HashMap < String , Object > headersArg = null ; String methodName = "unbindQueue" ; String methodId =...
This method unbinds a queue from an exchange .
139,088
public AmqpChannel qosBasic ( int prefetchSize , int prefetchCount , boolean global ) { Object [ ] args = { prefetchSize , prefetchCount , global } ; WrappedByteBuffer bodyArg = null ; HashMap < String , Object > headersArg = null ; String methodName = "qosBasic" ; String methodId = "60" + "10" ; AmqpMethod amqpMethod ...
This method requests a specific quality of service . The QoS can be specified for the current channel or for all channels on the connection . The particular properties and semantics of a qos method always depend on the content class semantics . Though the qos method could in principle apply to both peers it is currentl...
139,089
public AmqpChannel publishBasic ( ByteBuffer body , AmqpProperties properties , String exchange , String routingKey , boolean mandatory , boolean immediate ) { @ SuppressWarnings ( "unchecked" ) Map < String , Object > amqpProps = ( Map < String , Object > ) Collections . EMPTY_MAP ; if ( properties != null ) { amqpPro...
This method publishes a message to a specific exchange . The message will be routed to queues as defined by the exchange configuration and distributed to any active consumers when the transaction if any is committed .
139,090
public AmqpChannel getBasic ( String queue , boolean noAck ) { Object [ ] args = { 0 , queue , noAck } ; WrappedByteBuffer bodyArg = null ; HashMap < String , Object > headersArg = null ; String methodName = "getBasic" ; String methodId = "60" + "70" ; AmqpMethod amqpMethod = MethodLookup . LookupMethod ( methodId ) ; ...
Gets messages from the queue and dispatches it to the listener
139,091
private void fireOnOpen ( ChannelEvent e ) { if ( readyState == ReadyState . OPEN ) { return ; } readyState = ReadyState . OPEN ; List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListene...
Fired when channel is opened
139,092
private void fireOnDeclareExchange ( ChannelEvent e ) { List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onDeclareExchange ( e ) ; } }
Fired when exchange is declared
139,093
private void fireOnDeclareQueue ( ChannelEvent e ) { List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onDeclareQueue ( e ) ; } }
Fired when Queue is declared
139,094
private void fireOnBindQueue ( ChannelEvent e ) { List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onBindQueue ( e ) ; } }
Fired when Queue is bound
139,095
private void fireOnConsumeBasic ( ChannelEvent e ) { List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onConsumeBasic ( e ) ; } }
Fired on consume basic
139,096
private void fireOnCommitTransaction ( ChannelEvent e ) { List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onCommit ( e ) ; } }
Fired on transaction commit
139,097
private void fireOnRollbackTransaction ( ChannelEvent e ) { List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onRollback ( e ) ; } }
Fired on transaction rollbacked
139,098
private void fireOnSelectTransaction ( ChannelEvent e ) { List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onSelect ( e ) ; } }
Fired on transaction select
139,099
private void fireOnMessage ( ChannelEvent e ) { List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onMessage ( e ) ; } }
Fired on message retreival