Fixing stuff

This commit is contained in:
Wouter van Oijen 2006-05-21 14:49:40 +00:00
parent 38c78e3c62
commit 684f08649d
27 changed files with 672 additions and 414 deletions

View file

@ -37,7 +37,8 @@ These methods are available from this class:
#-------------------------------------------------------------------
=head1 canDelete
=head2 canDelete ( )
Returns true if this color can be deleted.
@ -50,7 +51,8 @@ sub canDelete {
}
#-------------------------------------------------------------------
=head1 copy
=head2 copy ( )
Returns a new WebGUI::Image::Color object being an exact copy of this color,
except for the persistency. This means that the new copy will not be stored in
@ -65,7 +67,8 @@ sub copy {
}
#-------------------------------------------------------------------
=head1 darken
=head2 darken ( )
Returns a new WebGUI::Image::Color object with the same properties but the
colors darkened. This object will not be saved to the database automatically.
@ -87,7 +90,8 @@ sub darken {
}
#-------------------------------------------------------------------
=head1 delete
=head2 delete ( )
Deletes the color from the database. It will only delete if canDelete returns
true.
@ -104,7 +108,8 @@ sub delete {
}
#-------------------------------------------------------------------
=head1 getFillColor
=head2 getFillColor ( )
Returns the the quartet of th fill color. The quartet consists of R, G, B and
Alpha values respectively in HTML format: '#rrggbbaa'.
@ -118,7 +123,8 @@ sub getFillColor {
}
#-------------------------------------------------------------------
=head1 getFillTriplet
=head2 getFillTriplet ( )
Returns the RGB triplet of the fill color in HTML format: '#rrggbb'.
@ -131,7 +137,8 @@ sub getFillTriplet {
}
#-------------------------------------------------------------------
=head1 getFillAlpha
=head2 getFillAlpha ( )
Returns the hex value of the Alpha channel in this color.
@ -144,7 +151,8 @@ sub getFillAlpha {
}
#-------------------------------------------------------------------
=head1 getId
=head2 getId ( )
Returns the GUID of this color.
@ -157,7 +165,8 @@ sub getId {
}
#-------------------------------------------------------------------
=head1 getName
=head2 getName ( )
Returns the name assigned to this color.
@ -170,7 +179,8 @@ sub getName {
}
#-------------------------------------------------------------------
=head1 getStrokeColor
=head2 getStrokeColor ( )
Returns the the quartet of the stroke color. The quartet consists of R, G, B and
Alpha values respectively in HTML format: '#rrggbbaa'.
@ -184,7 +194,8 @@ sub getStrokeColor {
}
#-------------------------------------------------------------------
=head1 getStrokeTriplet
=head2 getStrokeTriplet ( )
Returns the RGB triplet of the stroke color in HTML format: '#rrggbb'.
@ -197,7 +208,8 @@ sub getStrokeTriplet {
}
#-------------------------------------------------------------------
=head1 getStrokeAlpha
=head2 getStrokeAlpha ( )
Returns the hex value of the Alpha channel in the stroke color.
@ -210,41 +222,42 @@ sub getStrokeAlpha {
}
#-------------------------------------------------------------------
=head1 new ( session, colorId, [ properties ] )
=head2 new ( session, colorId, [ properties ] )
Constructor for this class.
=head2 session
=head3 session
A WebGUI::Session object.
=head2 colorId
=head3 colorId
The id of the color you want to instanciate. If you're creating a new color
please use 'new' as id.
=head2 properties
=head3 properties
A hashref containing configuration options to set this object to. All are also
available through methods.
=head3 name
=head4 name
The color name.
=head3 fillTriplet
=head4 fillTriplet
The RGB triplet for the fill color. See setFillTriplet.
=head3 fillAlpha
=head4 fillAlpha
The alpha value for the fill color. See setFillAlpha.
=head3 strokeTriplet
=head4 strokeTriplet
The RGB triplet for the stroke color. See setStrokeTriplet.
=head3 strokeAlpha
=head4 strokeAlpha
The alpha value for the stroke color. See setStrokeAlpha.
@ -275,16 +288,17 @@ sub new {
}
#-------------------------------------------------------------------
=head1 newByPalette ( session, paletteId )
=head2 newByPalette ( session, paletteId )
Returns an arrayref containg instanciated WebGUI::Image::Color objects for each
color in the sepcified palette.
=head2 session
=head3 session
A WebGUI::Session object.
=head2 paletteId
=head3 paletteId
The id of the palette that is to be loaded.
@ -309,7 +323,8 @@ sub newByPalette {
}
#-------------------------------------------------------------------
=head1 session
=head2 session ( )
Returns the WebGUI::Session object;
@ -322,11 +337,12 @@ sub session {
}
#-------------------------------------------------------------------
=head1 setFillColor ( quartet )
=head2 setFillColor ( quartet )
Sets the the fill color to the specified quartet.
=head2 quartet
=head3 quartet
The quartet consists of R, G, B and Alpha values respectively in HTML format: '#rrggbbaa'.
@ -345,11 +361,12 @@ sub setFillColor {
}
#-------------------------------------------------------------------
=head1 setFillTriplet ( triplet )
=head2 setFillTriplet ( triplet )
Sets the RGB triplet of the fill color.
=head2 triplet
=head3 triplet
The RGB triplet in HTML format: '#rrggbb'.
@ -368,11 +385,12 @@ sub setFillTriplet {
}
#-------------------------------------------------------------------
=head1 setFillAlpha ( alpha )
=head2 setFillAlpha ( alpha )
Sets the alpha channel for the fill color.
=head2 alpha
=head3 alpha
The alpha value in hexadecimal notation: 'ff';
@ -391,11 +409,12 @@ sub setFillAlpha {
}
#-------------------------------------------------------------------
=head1 setName ( name )
=head2 setName ( name )
Sets the name of this color.
=head2 name
=head3 name
A scalar containing the name of this color.
@ -410,11 +429,12 @@ sub setName {
}
#-------------------------------------------------------------------
=head1 setStrokeColor ( quartet )
=head2 setStrokeColor ( quartet )
Sets the the stroke color to the specified quartet.
=head2 quartet
=head3 quartet
The quartet consists of R, G, B and Alpha values respectively in HTML format: '#rrggbbaa'.
@ -433,11 +453,12 @@ sub setStrokeColor {
}
#-------------------------------------------------------------------
=head1 setStrokeTriplet ( triplet )
=head2 setStrokeTriplet ( triplet )
Sets the RGB triplet of the stroke color.
=head2 triplet
=head3 triplet
The RGB triplet in HTML format: '#rrggbb'.
@ -456,11 +477,12 @@ sub setStrokeTriplet {
}
#-------------------------------------------------------------------
=head1 setStrokeAlpha ( alpha )
=head2 setStrokeAlpha ( alpha )
Sets the alpha channel for the stroke color.
=head2 alpha
=head3 alpha
The alpha value in hexadecimal notation: 'ff';
@ -479,7 +501,8 @@ sub setStrokeAlpha {
}
#-------------------------------------------------------------------
=head1 update
=head2 update ( )
Will update the database to the current state of the object. If your object has
not yet been saved to the database, you must first use the save method, which
@ -501,7 +524,8 @@ sub update {
}
#-------------------------------------------------------------------
=head1 save
=head2 save ( )
Will save the state of the object to the database if the color is not yet in the
database. If it already is in the database this method will do exactly the same

View file

@ -34,6 +34,7 @@ These methods are available from this class:
=cut
#-------------------------------------------------------------------
=head2 addDataset ( dataset )
Adds a dataset to the graph. Please not that not all graph types can handle
@ -53,7 +54,8 @@ sub addDataset {
}
#-------------------------------------------------------------------
=head2 configurationForm
=head2 configurationForm ( )
Returns a hashref containing the form where the properties of your graph type
can be set. Your pluging should extend this method by append the form to the
@ -129,6 +131,7 @@ sub configurationForm {
}
#-------------------------------------------------------------------
=head2 drawLabel ( label, [ properties ] )
Draws a label with your preferred properties. Defaults the font, font size and
@ -160,7 +163,8 @@ sub drawLabel {
}
#-------------------------------------------------------------------
=head2 formNamespace
=head2 formNamespace ( )
Returns the namespace used in the configuration form. You must extend this
method by concatenating an underscore and the last part of your namespace to the
@ -175,7 +179,8 @@ sub formNamespace {
}
#-------------------------------------------------------------------
=head2 getConfiguration
=head2 getConfiguration ( )
Returns the configuration hashref of the plugin. You must extend this method by
adding your configuration keys to the hashref returned by the SUPER method. To
@ -205,6 +210,7 @@ sub getConfiguration {
}
#-------------------------------------------------------------------
=head2 getGraphingTab ( session, [ config ] )
Returns the contents of the graphing tab you can add to your asset.
@ -332,6 +338,7 @@ EOS
}
#-------------------------------------------------------------------
=head2 getDataset ( [ index ] )
Returns the dataset indicated by index.
@ -356,6 +363,7 @@ sub getDataset {
}
#-------------------------------------------------------------------
=head2 getLabel ( [ index ] )
Returns the index'th label or an arrayref containing all labels.
@ -376,6 +384,7 @@ sub getLabel {
}
#-------------------------------------------------------------------
=head2 getLabelColor
Returns the triplet of the label color. Defaults to '#333333'.
@ -389,6 +398,7 @@ sub getLabelColor {
}
#-------------------------------------------------------------------
=head2 getLabelDimensions ( text, [ properties ] )
Returns a hashref containg the width and height in pixels of the passed text.
@ -423,7 +433,8 @@ sub getLabelDimensions {
}
#-------------------------------------------------------------------
=head2 getLabelFont
=head2 getLabelFont ( )
Returns the WebGUI::Image::Font object this image is set to. Defaults to the
default font.
@ -437,7 +448,8 @@ sub getLabelFont {
}
#-------------------------------------------------------------------
=head2 getLabelFontSize
=head2 getLabelFontSize ( )
Returns the font size of the labels. Defaults to 20.
@ -450,7 +462,8 @@ sub getLabelFontSize {
}
#-------------------------------------------------------------------
=head2 getLabelOffset
=head2 getLabelOffset ( )
Returns the label offset. This is the distance between the label and the axis.
Defaults to 10 pixels.
@ -464,7 +477,8 @@ sub getLabelOffset {
}
#-------------------------------------------------------------------
=head2 getMaxValueFromDataset
=head2 getMaxValueFromDataset ( )
Returns the highest value of all added datasets.
@ -496,7 +510,8 @@ sub getMaxValueFromDataset {
}
#-------------------------------------------------------------------
=head2 getPluginList
=head2 getPluginList ( )
Returns an arrayref containing the namespaces of the enabled graphing plugins.
@ -510,6 +525,7 @@ sub getPluginList {
}
#-------------------------------------------------------------------
=head2 load ( session, namespace )
Instanciates an WebGUI::Graph object with the given namespace.
@ -538,6 +554,7 @@ sub load {
}
#-------------------------------------------------------------------
=head2 loadByConfiguration ( session, configuration )
Loads a plugin defined by a configuration hash.
@ -569,6 +586,7 @@ sub loadByConfiguration {
}
#-------------------------------------------------------------------
=head2 processConfigurationForm ( session )
Processes the configuration form that is submitted and returns the correct
@ -599,6 +617,7 @@ my $graph = $class->load($session, $namespace);
}
#-------------------------------------------------------------------
=head2 setConfiguration ( config )
Configures the pluging according to the configuration hashref that is passed.
@ -627,6 +646,7 @@ sub setConfiguration {
};
#-------------------------------------------------------------------
=head2 setLabelColor ( color )
Sets the color triplet of the labels.
@ -645,6 +665,7 @@ sub setLabelColor {
}
#-------------------------------------------------------------------
=head2 setLabelFont ( font )
Set the label font.
@ -663,6 +684,7 @@ sub setLabelFont {
}
#-------------------------------------------------------------------
=head2 setLabelFontSize ( size )
Sets the font size of the labels.
@ -681,6 +703,7 @@ sub setLabelFontSize {
}
#-------------------------------------------------------------------
=head2 setLabelOffset ( offset )
Sets the label offset. This is the distance in pixels between the labels and the
@ -700,6 +723,7 @@ sub setLabelOffset {
}
#-------------------------------------------------------------------
=head2 setLabels ( labels )
Sets the labels for the datasets.
@ -718,6 +742,7 @@ sub setLabels {
}
#-------------------------------------------------------------------
=head2 wrapLabelToWidth ( text, maxWidth, [ properties ] )
Wraps a text string onto multiple lines having a width of maxWidth.

View file

@ -33,6 +33,7 @@ These methods are available from this class:
=cut
#-------------------------------------------------------------------
=head2 _mod2pi ( angle )
Returns the angle modulo 2*pi.
@ -258,6 +259,7 @@ sub addSlice {
}
#-------------------------------------------------------------------
=head2 calcCoordinates ( slice )
Calcs the coordinates of the corners of the given pie slice.
@ -296,7 +298,8 @@ sub calcCoordinates {
}
#-------------------------------------------------------------------
=head2 configurationForm
=head2 configurationForm ( )
The configuration form part for this object. See WebGUI::Image::Graph for
documentation.
@ -387,7 +390,8 @@ my $configForms = $self->SUPER::configurationForm;
}
#-------------------------------------------------------------------
=head2 draw
=head2 draw ( )
Draws the pie chart.
@ -452,6 +456,7 @@ sub draw {
}
#-------------------------------------------------------------------
=head2 drawBottom ( slice )
Draws the bottom of the given pie slice.
@ -470,6 +475,7 @@ sub drawBottom {
}
#-------------------------------------------------------------------
=head2 drawLabel ( slice )
Draws the label including stick if needed for the given pie slice.
@ -563,6 +569,7 @@ sub drawLabel {
}
#-------------------------------------------------------------------
=head2 drawLeftSide ( slice )
Draws the side connected to the startpoint of the slice.
@ -581,6 +588,7 @@ sub drawLeftSide {
}
#-------------------------------------------------------------------
=head2 drawPieSlice ( slice, offset, fillColor )
Draws a pie slice shape, ie. the bottom or top of a slice.
@ -638,6 +646,7 @@ sub drawPieSlice {
}
#-------------------------------------------------------------------
=head2 drawRightSide ( slice )
Draws the side connected to the endpoint of the slice.
@ -656,6 +665,7 @@ sub drawRightSide {
}
#-------------------------------------------------------------------
=head2 drawRim ( slice )
Draws the rim of the slice.
@ -708,6 +718,7 @@ sub drawRim {
}
#-------------------------------------------------------------------
=head2 drawSide ( slice, [ cornerName ], [ fillColor ] )
Draws the sides connecting the rim and tip of a pie slice.
@ -767,6 +778,7 @@ sub drawSide {
}
#-------------------------------------------------------------------
=head2 drawBottom ( slice )
Draws the bottom of the given pie slice.
@ -785,7 +797,8 @@ sub drawTop {
}
#-------------------------------------------------------------------
=head2 formNamespace
=head2 formNamespace ( )
Extends the form namespace for this object. See WebGUI::Image::Graph for
documentation.
@ -799,7 +812,8 @@ sub formNamespace {
}
#-------------------------------------------------------------------
=head2 getBottomHeight
=head2 getBottomHeight ( )
Returns the thickness of the bottom. Defaults to 0.
@ -812,7 +826,8 @@ sub getBottomHeight {
}
#-------------------------------------------------------------------
=head2 getConfiguration
=head2 getConfiguration ( )
Returns a configuration hashref. See WebGUI::Image::Graph for documentation.
@ -837,7 +852,8 @@ sub getConfiguration {
}
#-------------------------------------------------------------------
=head2 getDataset
=head2 getDataset ( )
Returns the first dataset that is added. Pie charts can only handle one dataset
and therefore the first added dataset is used.
@ -851,7 +867,8 @@ sub getDataset {
}
#-------------------------------------------------------------------
=head2 getExplosionLength
=head2 getExplosionLength ( )
Returns the explosion length. This value indicates how much a slice will be
shifted from the center of the pie. Defaults to 0.
@ -865,7 +882,8 @@ sub getExplosionLength {
}
#-------------------------------------------------------------------
=head2 getLabels
=head2 getLabels ( )
Returns an arrayref containing the labels that belong to the slices.
@ -878,7 +896,8 @@ sub getLabels {
}
#-------------------------------------------------------------------
=head2 getLabelPosition
=head2 getLabelPosition ( )
Returns the position of the labels relative to the thickness of the pie.
Allowed positions are 'bottom', 'center' and 'top'. Defaults to 'top'.
@ -892,7 +911,8 @@ sub getLabelPosition {
}
#-------------------------------------------------------------------
=head2 getPieMode
=head2 getPieMode ( )
Returns the mode in which the pie is drawn. Currently available are 'normal' and
'stepped'. The latter mode draws each pie slice with a smaller thickness,
@ -908,7 +928,8 @@ sub getPieMode {
}
#-------------------------------------------------------------------
=head2 getRadius
=head2 getRadius ( )
Returns the radius of the pie in pixels. Defaults to 80.
@ -921,7 +942,8 @@ sub getRadius {
}
#-------------------------------------------------------------------
=head2 getScaleFactor
=head2 getScaleFactor ( )
Returns the factor with which the pies that are added afterwards should be
scaled. In effect this will cause the radius of the slice to grow or shrink, and
@ -938,6 +960,7 @@ sub getScaleFactor {
}
#-------------------------------------------------------------------
=head2 getSlice ( [ sliceNumber ] )
Returns the sliceNumber'th slice properties hashref. Defaults to the slice last
@ -948,6 +971,7 @@ added.
The index of the slice you want.
=cut
sub getSlice {
my $self = shift;
my $slice = shift || (scalar(@{$self->{_slices}}) - 1);
@ -956,7 +980,8 @@ sub getSlice {
}
#-------------------------------------------------------------------
=head2 getStartAngle
=head2 getStartAngle ( )
Rteurn the initial angle of the first slice. In effect all slices are rotated by
this value.
@ -970,7 +995,8 @@ sub getStartAngle {
}
#-------------------------------------------------------------------
=head2 getStickColor
=head2 getStickColor ( )
Returns the color of the sticks connecting pie and labels. Defaults to #333333.
@ -983,7 +1009,8 @@ sub getStickColor {
}
#-------------------------------------------------------------------
=head2 getStickLength
=head2 getStickLength ( )
Return the length of the sticks connecting the labels with the pie. Defaults to
0.
@ -997,7 +1024,8 @@ sub getStickLength {
}
#-------------------------------------------------------------------
=head2 getStickOffset
=head2 getStickOffset ( )
Returns the distance between the label sticks and the pie. Defaults to 0.
@ -1010,7 +1038,8 @@ sub getStickOffset {
}
#-------------------------------------------------------------------
=head2 getTiltAngle
=head2 getTiltAngle ( )
Returns the angle between the screen and the pie chart. Valid angles are 0 to 90
degrees. Zero degrees results in a 2d pie where other values will generate a 3d
@ -1027,7 +1056,8 @@ sub getTiltAngle {
}
#-------------------------------------------------------------------
=head2 getTopHeight
=head2 getTopHeight ( )
Returns the thickness of the top of the pie in pixels. Defaults to 20 pixels.
@ -1041,7 +1071,8 @@ sub getTopHeight {
}
#-------------------------------------------------------------------
=head2 hasShadedSides
=head2 hasShadedSides ( )
A boolean value indicating whether the sides and the rim of the pie should be
drawn with a darkened color.
@ -1055,7 +1086,8 @@ sub hasShadedSides {
}
#-------------------------------------------------------------------
=head2 new
=head2 new ( )
Contstructor. See SUPER classes for additional parameters.
@ -1071,7 +1103,8 @@ sub new {
}
#-------------------------------------------------------------------
=head2 processDataset
=head2 processDataset ( )
Takes the dataset and takes the necesarry steps for the pie to be drawn.
@ -1101,6 +1134,7 @@ sub processDataset {
}
#-------------------------------------------------------------------
=head2 setBottomHeight ( thickness )
Sets the thickness of the bottom.
@ -1119,6 +1153,7 @@ sub setBottomHeight {
}
#-------------------------------------------------------------------
=head2 setCenter( [ xOffset ], [ yOffset ] )
Sets the offset of the center of the graph relative to the center of the image.
@ -1143,6 +1178,7 @@ sub setCenter {
}
#-------------------------------------------------------------------
=head2 setConfiguration ( config )
Applies the settings in the given configuration hash. See WebGUI::Image::Graph
@ -1175,6 +1211,7 @@ sub setConfiguration {
}
#-------------------------------------------------------------------
=head2 setExplosionLength ( length )
Sets the explosion length. This value indicates how much a slice will be
@ -1194,6 +1231,7 @@ sub setExplosionLength {
}
#-------------------------------------------------------------------
=head2 setLabelPosition ( position )
Sets the position of the labels relative to the thickness of the pie.
@ -1213,6 +1251,7 @@ sub setLabelPosition {
}
#-------------------------------------------------------------------
=head2 setPieMode ( mode )
Sets the mode in which the pie is drawn. Currently available are 'normal' and
@ -1234,6 +1273,7 @@ sub setPieMode {
}
#-------------------------------------------------------------------
=head2 setRadius ( radius )
Sets the radius of the pie in pixels. Defaults to 80.
@ -1254,6 +1294,7 @@ sub setRadius {
}
#-------------------------------------------------------------------
=head2 setScaleFactor ( multiplier )
Sets the factor with which the pies that are added afterwards should be
@ -1276,6 +1317,7 @@ sub setScaleFactor {
}
#-------------------------------------------------------------------
=head2 setStartAngle ( angle )
Sets the initial angle of the first slice. In effect all slices are rotated by
@ -1295,6 +1337,7 @@ sub setStartAngle {
}
#-------------------------------------------------------------------
=head2 setShadedSides ( shaded )
A boolean value indicating whether the sides and the rim of the pie should be
@ -1314,6 +1357,7 @@ sub setShadedSides {
}
#-------------------------------------------------------------------
=head2 setStickColor ( color )
Sets the color of the sticks connecting pie and labels. Defaults to #333333.
@ -1332,6 +1376,7 @@ sub setStickColor {
}
#-------------------------------------------------------------------
=head2 setStickLength ( length )
Sets the length of the sticks connecting the labels with the pie. Defaults to
@ -1351,6 +1396,7 @@ sub setStickLength {
}
#-------------------------------------------------------------------
=head2 setStickOffset ( offset )
Sets the distance between the label sticks and the pie. Defaults to 0.
@ -1369,6 +1415,7 @@ sub setStickOffset {
}
#-------------------------------------------------------------------
=head2 setTiltAngle ( angle )
Sets the angle between the screen and the pie chart. Valid angles are 0 to 90
@ -1394,6 +1441,7 @@ sub setTiltAngle {
}
#-------------------------------------------------------------------
=head2 setTopHeight ( thickness )
Sets the thickness of the top of the pie in pixels. Defaults to 20 pixels.
@ -1412,6 +1460,7 @@ sub setTopHeight {
}
#-------------------------------------------------------------------
=head2 sortSlices
A sort routine for sorting the slices in drawing order. Must be run from within

View file

@ -27,6 +27,7 @@ These methods are available from this class:
=cut
#-------------------------------------------------------------------
=head2 addColor ( color )
Adds a color to this palette. The color will be automatically saved or updated
@ -54,7 +55,8 @@ sub addColor {
}
#-------------------------------------------------------------------
=head2 canDelete
=head2 canDelete ( )
Returns true if this palette can be deleted.
@ -68,7 +70,8 @@ sub canDelete {
}
#-------------------------------------------------------------------
=head2 canEdit
=head2 canEdit ( )
Returns true if this palette can be edited.
@ -81,7 +84,8 @@ sub canEdit {
}
#-------------------------------------------------------------------
=head2 delete
=head2 delete ( )
Deletes the palette from the database. This is only possible if the canDelete
method returns true.
@ -104,6 +108,7 @@ sub delete {
}
#-------------------------------------------------------------------
=head2 getColor ( [ index ] )
Returns the color at index in the palette. If index is not passed it will return
@ -120,6 +125,7 @@ sub getColor {
}
#-------------------------------------------------------------------
=head2 getColorIndex ( color )
Returns the index of color. If the color is not in the palette it will return
@ -146,7 +152,8 @@ sub getColorIndex {
}
#-------------------------------------------------------------------
=head2 getColorsInPalette
=head2 getColorsInPalette ( )
Returns a arrayref containing all color objects in the palette.
@ -160,7 +167,8 @@ sub getColorsInPalette {
}
#-------------------------------------------------------------------
=head2 getDefaultPaletteId
=head2 getDefaultPaletteId ( )
Returns the id of the default palette.
@ -173,7 +181,8 @@ sub getDefaultPaletteId {
}
#-------------------------------------------------------------------
=head2 getId
=head2 getId ( )
Returns the guid of this palette.
@ -186,7 +195,8 @@ sub getId {
}
#-------------------------------------------------------------------
=head2 getName
=head2 getName ( )
Returns the name of this palette.
@ -199,7 +209,8 @@ sub getName {
}
#-------------------------------------------------------------------
=head2 getNextColor
=head2 getNextColor ( )
Returns the next color in the palette relative to the internal palette index
counter, and increases this counter to that color. If the counter already is at
@ -219,7 +230,8 @@ sub getNextColor {
}
#-------------------------------------------------------------------
=head2 getNumberOfColors
=head2 getNumberOfColors ( )
Returns the number of colors in the palette.
@ -232,7 +244,8 @@ sub getNumberOfColors {
}
#-------------------------------------------------------------------
=head2 getPaletteIndex
=head2 getPaletteIndex ( )
Returns the index the internal palette index counter is set to. Ie. it returns
the current color.
@ -246,7 +259,8 @@ sub getPaletteIndex {
}
#-------------------------------------------------------------------
=head2 getPaletteList
=head2 getPaletteList ( )
Returns a hashref containing a list of all available palettes. The keys are the
palette id's and the value are the names of the palettes.
@ -261,7 +275,8 @@ sub getPaletteList {
}
#-------------------------------------------------------------------
=head2 getPreviousColor
=head2 getPreviousColor ( )
Returns the previous color in the palette relative to the internal palette index
counter, and decreases this counter to that color. If the counter already is at
@ -281,7 +296,8 @@ sub getPreviousColor {
}
#-------------------------------------------------------------------
=head2 new ( session, paletteId, [ name ])
=head2 new ( session, paletteId, [ name ] )
Constructor for this class.
@ -338,6 +354,7 @@ sub new {
}
#-------------------------------------------------------------------
=head2 removeColor ( index )
Removes color at index.
@ -373,7 +390,8 @@ sub removeColor {
}
#-------------------------------------------------------------------
=head2 session
=head2 session ( )
Returns the WebGUI::Session object.
@ -386,6 +404,7 @@ sub session {
}
#-------------------------------------------------------------------
=head2 setColor ( index, color )
Sets palette position index to color. This method will automatically save or
@ -424,7 +443,8 @@ sub setColor {
}
#-------------------------------------------------------------------
=head setName ( name )
=head2 setName ( name )
Set the name of this palette.
@ -447,6 +467,7 @@ sub setName {
}
#-------------------------------------------------------------------
=head2 setPaletteIndex ( index )
Set the internal palette index counter. In other words, it sets the current
@ -472,6 +493,7 @@ sub setPaletteIndex {
}
#-------------------------------------------------------------------
=head2 swapColors ( firstIndex, secondIndex )
Swaps the position of two colors within the palette.