diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-01-20 14:24:34 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-01-20 14:24:34 +1000 |
commit | 869c206c4fcc8001bd2e1d66f704290331813835 (patch) | |
tree | 96735ce8fe4665e2759c3374221d6f06f4527df2 /src/Java/binnie/extrabees/gui/punnett/ControlChromosome.java | |
parent | ec2c72827f01dd4bb2174137f1ab162f9ddaab62 (diff) | |
download | GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.tar.gz GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.tar.bz2 GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.zip |
Initial Commit
Diffstat (limited to 'src/Java/binnie/extrabees/gui/punnett/ControlChromosome.java')
-rw-r--r-- | src/Java/binnie/extrabees/gui/punnett/ControlChromosome.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/Java/binnie/extrabees/gui/punnett/ControlChromosome.java b/src/Java/binnie/extrabees/gui/punnett/ControlChromosome.java new file mode 100644 index 0000000000..f4a7ffc507 --- /dev/null +++ b/src/Java/binnie/extrabees/gui/punnett/ControlChromosome.java @@ -0,0 +1,49 @@ +package binnie.extrabees.gui.punnett; + +import binnie.craftgui.controls.core.Control; +import binnie.craftgui.controls.core.IControlValue; +import binnie.craftgui.core.Attribute; +import binnie.craftgui.core.CraftGUI; +import binnie.craftgui.core.ITooltip; +import binnie.craftgui.core.IWidget; +import binnie.craftgui.core.Tooltip; +import binnie.craftgui.core.renderer.Renderer; +import forestry.api.genetics.IChromosomeType; + +public class ControlChromosome + extends Control + implements IControlValue<IChromosomeType>, ITooltip +{ + IChromosomeType value; + + protected ControlChromosome(IWidget parent, float x, float y, IChromosomeType type) + { + super(parent, x, y, 16.0F, 16.0F); + setValue(type); + addAttribute(Attribute.MouseOver); + } + + public IChromosomeType getValue() + { + return this.value; + } + + public void setValue(IChromosomeType value) + { + this.value = value; + } + + public void onRenderBackground() + { + CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome, getArea()); + CraftGUI.Render.colour(16711680); + CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome2, getArea()); + } + + public void getTooltip(Tooltip tooltip) + { + if (this.value != null) { + tooltip.add(this.value.getName()); + } + } +} |