Table of Contents
4 Classes for the graphical user interface
4.1 The default panels
For a configured game panel, the custom class must be derived from ConfigurableGamePanel.
The layout of the element is done via the File for the game configurations in the Configurable Layout area.
If necessary, the layout can be influenced programmatically.
You can use isPaintPartsAllowed to generally determine whether the elements should be drawn. This can be used, for example, to control whether drawing should only take place once the game has been started.
The elements are drawn using the Painter classes. There is a separate Painter class for each element type. If a separate Painter class is to be used, the corresponding method that creates the Painter class must be overwritten. The following methods are available for this:
createAreaPainter: Returns the instance that is used to draw areas. The class must be derived from AreaPainter.createPiecesetPainter: Returns the instance that is used to draw piece sets. The class must be derived from PiecesetPainter.createCardsetPainter: Returns the instance that is used to draw card sets. The class must be derived from CardsetPainter.createPartPainter: Returns the instance that is used to draw user-defined objects. The class must be derived from PartPainter.createPartsetPainter: Returns the instance that is used to draw sets of user-defined objects. The class must be derived from PartsetPainter.createPlayerInfoPainter: Returns the instance that is used to draw player information. The class must be derived from PlayerInfoPainter.The Painter classes offer further options for exerting influence. All the methods listed below are passed the element to be drawn. This can be used to query which element is to be drawn. For an area via getName(), otherwise via getType(). Other getter methods can be used to access the element values specified in the configuration.
This class is responsible for drawing areas.
shouldPaint: Determines whether the area should be drawn. By default, areas are only drawn if the hidden attribute has been explicitly set to false in the File for the game configurations for the area.getPaintDimension: Returns the size of the area.getPaintPosition: Returns the position of the area.getColor: Returns the color with which the area is drawn. The default color is black.paint: Draws the area. By default, the area is drawn as an unfilled rectangle if the area is not hidden.This class is responsible for drawing piece sets.
getActiveElement: Returns the active piece set (PieceSet).getActiveElements: Returns the individual pieces from the active piece set.shouldPaint: Determines whether the pieces should be drawn.getPercentSize: Returns the percentage value with which the images of the pieces are to be drawn.getScale: Returns the scaling type (see ScaleType).getPaintAngle: Returns the degree of rotation with which the images of the pieces are to be drawn.getPaintDimension: Returns the size of the area required for drawing the pieces.getPaintPosition: Returns the position at which to start drawing the pieces.getPaintSpacing: Returns the spacing of the individual pieces.getPaintOrientation: Provides the orientation (see 'Orientation') in which the pieces are drawn.getPaintWrapThreshold: Returns the value after how many pieces should be wrapped if the orientation is used for drawing.isSelected: Determines whether a piece of the set is selected.getSelectionColor: Returns the color with which the selection should be drawn.getSelectedIndex: Returns the index of the selected piece.paint: Draws the pieces.This class is responsible for drawing card sets.
getActiveElement: Returns the active card set (CardSet).getActiveElements: Returns the individual cards from the active card set.shouldPaint: Determines whether the cards should be drawn.getPercentSize: Returns the percentage value with which the images of the cards are to be drawn.getScale: Returns the scaling type (see ScaleType).getPlayerIndex: Returns the index of the player for which the cards are to be drawn.getPaintAngle: Returns the degree of rotation with which the images of the cards are to be drawn.getPaintDimension: Returns the size of the area required for drawing the cards.getPaintPosition: Returns the position at which to start drawing the cards.getPaintSpacing: Returns the spacing of the individual cards.getPaintOrientation: Provides the orientation (see 'Orientation') in which the cards are drawn.getPaintWrapThreshold: Returns the value after how many cards should be wrapped if the orientation is used for drawing.isSelected: Determines whether a card of the set is selected.getSelectionColor: Returns the color with which the selection should be drawn.getSelectedIndex: Returns the index of the selected card.paint: Draws the cards.This class is responsible for drawing user-defined objects.
getActiveElement: Returns the active object (Part).shouldPaint: Determines whether the object should be drawn.getPercentSize: Returns the percentage value with which the image of the object is to be drawn.getScale: Returns the scaling type (see ScaleType).getPaintAngle: Returns the degree of rotation with which the image of the object is to be drawn.getPaintDimension: Returns the size of the area required for drawing the object.getPaintPosition: Returns the position at which the object is drawn.isSelected: Determines whether the object is selected.getSelectionColor: Returns the color with which the selection should be drawn.paint: Draws the object.This class is responsible for drawing sets of user-defined objects.
getActiveElement: Returns the active object set (PartSet).getActiveElements: Returns the individual objects from the active object set.shouldPaint: Determines whether the objects are to be drawn.getPercentSize: Returns the percentage value with which the images of the objects are to be drawn.getScale: Returns the scaling type (see ScaleType).getPaintAngle: Returns the degree of rotation with which the images of the objects are to be drawn.getPaintDimension: Returns the size of the area required for drawing the objects.getPaintPosition: Returns the position at which the drawing of the objects is started.getPaintSpacing: Returns the spacing of the individual objects.getPaintOrientation: Returns the orientation (see 'Orientation') in which the objects are drawn.getPaintWrapThreshold: Returns the value after how many objects should be wrapped if the orientation is used for drawing.isSelected: Determines whether an object of the set is selected.getSelectionColor: Returns the color with which the selection should be drawn.getSelectedIndex: Returns the index of the selected object.paint: Draws the objects.This class is responsible for drawing player information.
shouldPaint: Determines whether the information is to be drawn.getScale: Returns the scaling type (see ScaleType).getColor: Returns the color with which the information is drawn.getPlayerIndex: Returns the index of the player for which the information is to be drawn.getPlayer: Returns the player for which the information is to be drawn.getInformation: Returns the information which is to be drawn.getNameInformation: Returns the information of the type NAME.getGameScoreInformation: Returns the information of the type GAME_SCORE.getRoundScoreInformation: Returns the information of the type ROUND_SCORE.getTurnScoreInformation: Returns the information of the type TURN_SCORE.getFontSize: Returns the font size with which the information is to be drawn.getPaintAngle: Returns the degree of rotation with which the information is to be drawn. This attribute is not available on Android!getPaintDimension: Returns the size of the area required for drawing the information.getPaintPosition: Returns the position at which the information is drawn.paint: Draws the information.