|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KPalette
public class KPalette
Class for handling Palettes. This class makes it easy to handle palettes. A palette is a set of colors. This class can read and write palettes from and to a file. This class uses the "GIMP" palette file format. This class is totally unrelated to QPalette.
Field Summary | |
---|---|
static int |
Ask
|
static int |
No
|
static int |
Yes
Used to specify whether a palette may be edited. |
Constructor Summary | |
---|---|
|
KPalette()
|
protected |
KPalette(java.lang.Class dummy)
|
|
KPalette(KPalette arg1)
KPalette copy constructor. |
|
KPalette(java.lang.String name)
KPalette constructor. |
Method Summary | |
---|---|
int |
addColor(org.kde.qt.QColor newColor)
|
int |
addColor(org.kde.qt.QColor newColor,
java.lang.String newColorName)
Add a color. |
int |
changeColor(int index,
org.kde.qt.QColor newColor)
|
int |
changeColor(int index,
org.kde.qt.QColor newColor,
java.lang.String newColorName)
Change a color. |
int |
changeColor(org.kde.qt.QColor oldColor,
org.kde.qt.QColor newColor)
|
int |
changeColor(org.kde.qt.QColor oldColor,
org.kde.qt.QColor newColor,
java.lang.String newColorName)
Change a color. |
org.kde.qt.QColor |
color(int index)
Find color by index. |
java.lang.String |
colorName(int index)
Find color name by index. |
java.lang.String |
colorName(org.kde.qt.QColor color)
Find color name by color. |
java.lang.String |
description()
Get the description of the palette. |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
int |
editable()
Returns whether the palette may be edited. |
protected void |
finalize()
Deletes the wrapped C++ instance |
int |
findColor(org.kde.qt.QColor color)
Find index by color. |
static java.util.ArrayList |
getPaletteList()
Query which KDE palettes are installed. |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
java.lang.String |
name()
Get the name of the palette. |
int |
nrColors()
Return the number of colors in the palette. |
boolean |
save()
Save the palette |
void |
setDescription(java.lang.String desc)
Set the description of the palette. |
void |
setEditable(int editable)
Change whether the palette may be edited. |
void |
setName(java.lang.String name)
Set the name of the palette. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int Yes
editable()
,
setEditable(int)
,
Constant Field Valuespublic static final int No
public static final int Ask
Constructor Detail |
---|
protected KPalette(java.lang.Class dummy)
public KPalette(java.lang.String name)
name
- The name of palette as returned by getPaletteList()public KPalette()
public KPalette(KPalette arg1)
Method Detail |
---|
public boolean save()
public java.lang.String description()
public void setDescription(java.lang.String desc)
desc
- the new descriptionpublic java.lang.String name()
public void setName(java.lang.String name)
name
- the name of the palettepublic int editable()
public void setEditable(int editable)
editable
- the state of the palettepublic int nrColors()
public org.kde.qt.QColor color(int index)
index
- the index of the desired color
index
-th color of the palette, null if not found.public int findColor(org.kde.qt.QColor color)
color.
color
- the color to find
public java.lang.String colorName(int index)
index.
index
- the index of the color
index
-th color.
Note that not all palettes have named the colors. Null is
returned if the color does not exist or has no name.public java.lang.String colorName(org.kde.qt.QColor color)
color.
public int addColor(org.kde.qt.QColor newColor, java.lang.String newColorName)
newColor
- The color to add.newColorName
- The name of the color, null to remove
the name.
public int addColor(org.kde.qt.QColor newColor)
public int changeColor(int index, org.kde.qt.QColor newColor, java.lang.String newColorName)
index
- Index of the color to changenewColor
- The new color.newColorName
- The new color name, null to remove
the name.
public int changeColor(int index, org.kde.qt.QColor newColor)
public int changeColor(org.kde.qt.QColor oldColor, org.kde.qt.QColor newColor, java.lang.String newColorName)
oldColor
- The original colornewColor
- The new color.newColorName
- The new color name, null to remove
the name.
public int changeColor(org.kde.qt.QColor oldColor, org.kde.qt.QColor newColor)
public static java.util.ArrayList getPaletteList()
protected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |