com.realtime.crossfire.jxclient.skin.factory
Class DialogFactory

java.lang.Object
  extended by com.realtime.crossfire.jxclient.skin.factory.DialogFactory

public class DialogFactory
extends java.lang.Object

A factory class to create "textbutton" instances.


Field Summary
private  float alpha
          y The alpha value for the dialog background except for the title.
private  java.awt.image.BufferedImage frameC
          The center frame picture.
private  java.awt.image.BufferedImage frameE
          The east frame picture.
private  java.awt.image.BufferedImage frameN
          The north frame picture.
private  java.awt.image.BufferedImage frameNE
          The north-east frame picture.
private  java.awt.image.BufferedImage frameNW
          The north-west frame picture.
private  java.awt.image.BufferedImage frameS
          The south frame picture.
private  java.awt.image.BufferedImage frameSE
          The south-east frame picture.
private  java.awt.image.BufferedImage frameSW
          The south-west frame picture.
private  java.awt.image.BufferedImage frameW
          The west frame picture.
private  int sizeE
          The size of the east border in pixels.
private  int sizeN
          The size of the north border in pixels.
private  int sizeS
          The size of the south border in pixels.
private  int sizeW
          The size of the west border in pixels.
private  java.awt.Color titleBackgroundColor
          The background color for the dialog title.
private  java.awt.Color titleColor
          The color for the dialog title.
private  java.awt.Font titleFont
          The font for the dialog title.
 
Constructor Summary
DialogFactory(java.awt.image.BufferedImage frameNW, java.awt.image.BufferedImage frameN, java.awt.image.BufferedImage frameNE, java.awt.image.BufferedImage frameW, java.awt.image.BufferedImage frameC, java.awt.image.BufferedImage frameE, java.awt.image.BufferedImage frameSW, java.awt.image.BufferedImage frameS, java.awt.image.BufferedImage frameSE, java.awt.Font titleFont, java.awt.Color titleColor, java.awt.Color titleBackgroundColor, float alpha)
          Create a new instance.
 
Method Summary
 java.lang.Iterable<GUIElement> newDialog(TooltipManager tooltipManager, JXCWindowRenderer windowRenderer, GUIElementListener elementListener, java.lang.String name, Expression w, Expression h, java.lang.String title)
          Create a new dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alpha

private final float alpha
y The alpha value for the dialog background except for the title.


frameC

@NotNull
private final java.awt.image.BufferedImage frameC
The center frame picture.


frameE

@NotNull
private final java.awt.image.BufferedImage frameE
The east frame picture.


frameN

@NotNull
private final java.awt.image.BufferedImage frameN
The north frame picture.


frameNE

@NotNull
private final java.awt.image.BufferedImage frameNE
The north-east frame picture.


frameNW

@NotNull
private final java.awt.image.BufferedImage frameNW
The north-west frame picture.


frameS

@NotNull
private final java.awt.image.BufferedImage frameS
The south frame picture.


frameSE

@NotNull
private final java.awt.image.BufferedImage frameSE
The south-east frame picture.


frameSW

@NotNull
private final java.awt.image.BufferedImage frameSW
The south-west frame picture.


frameW

@NotNull
private final java.awt.image.BufferedImage frameW
The west frame picture.


sizeE

private final int sizeE
The size of the east border in pixels.


sizeN

private final int sizeN
The size of the north border in pixels.


sizeS

private final int sizeS
The size of the south border in pixels.


sizeW

private final int sizeW
The size of the west border in pixels.


titleBackgroundColor

private final java.awt.Color titleBackgroundColor
The background color for the dialog title.


titleColor

private final java.awt.Color titleColor
The color for the dialog title.


titleFont

private final java.awt.Font titleFont
The font for the dialog title.

Constructor Detail

DialogFactory

public DialogFactory(@NotNull
                     java.awt.image.BufferedImage frameNW,
                     @NotNull
                     java.awt.image.BufferedImage frameN,
                     @NotNull
                     java.awt.image.BufferedImage frameNE,
                     @NotNull
                     java.awt.image.BufferedImage frameW,
                     @NotNull
                     java.awt.image.BufferedImage frameC,
                     @NotNull
                     java.awt.image.BufferedImage frameE,
                     @NotNull
                     java.awt.image.BufferedImage frameSW,
                     @NotNull
                     java.awt.image.BufferedImage frameS,
                     @NotNull
                     java.awt.image.BufferedImage frameSE,
                     @NotNull
                     java.awt.Font titleFont,
                     @NotNull
                     java.awt.Color titleColor,
                     @NotNull
                     java.awt.Color titleBackgroundColor,
                     float alpha)
Create a new instance. The border images must have matching sizes.

Parameters:
frameNW - The north-west frame picture.
frameN - The north frame picture.
frameNE - The north-east frame picture.
frameW - The west frame picture.
frameC - The center frame picture.
frameE - The east frame picture.
frameSW - The south-west frame picture.
frameS - The south frame picture.
frameSE - The south-east frame picture.
titleFont - The font for the dialog title.
titleColor - The color for the dialog title.
titleBackgroundColor - The background color for the dialog title.
alpha - The alpha value for the dialog background except for the title.
Method Detail

newDialog

@NotNull
public java.lang.Iterable<GUIElement> newDialog(@NotNull
                                                        TooltipManager tooltipManager,
                                                        @NotNull
                                                        JXCWindowRenderer windowRenderer,
                                                        @NotNull
                                                        GUIElementListener elementListener,
                                                        @NotNull
                                                        java.lang.String name,
                                                        @NotNull
                                                        Expression w,
                                                        @NotNull
                                                        Expression h,
                                                        @NotNull
                                                        java.lang.String title)
Create a new dialog.

Parameters:
tooltipManager - the tooltip manager to update
windowRenderer - the window renderer the dialog belongs to
elementListener - the element listener to notify
name - The base name of the dialog's gui elements.
w - The width of the dialog, including the frames.
h - The height of the dialog, including the frames.
title - The dialog's title, or an empty string for no title.
Returns:
The gui elements comprising the new dialog.