info.bliki.wiki.model
Class ImageFormat

java.lang.Object
  extended by info.bliki.wiki.model.ImageFormat

public class ImageFormat
extends java.lang.Object

Represents an [[Image:....]] wiki link with all the possible attributes. Copied from Patch #1488331 sf.net user: o_rossmueller; modified by axelclk http ://sourceforge.net/tracker/index.php?func=detail&aid=1488331&group_id= 128886 &atid=713150


Constructor Summary
ImageFormat()
           
 
Method Summary
 java.lang.String getAlt()
           
 java.lang.String getCaption()
           
 java.lang.String getFilename()
           
 int getHeight()
          Get the height of the image in pixel (example: "600px")
 java.lang.String getHeightStr()
          Get the height of the image as a string
static ImageFormat getImageFormat(java.lang.String rawImageLink, java.lang.String imageNamespace)
           
 java.lang.String getLink()
          Get the "e;link="e; attribute from the [[Image:...]] wiki link.
 java.lang.String getLocation()
           
 java.lang.String getNamespace()
           
 java.lang.String getType()
           
 int getWidth()
          Get the width of the image in pixel (example: "600px")
 java.lang.String getWidthStr()
          Get the width of the image as a string
 void setAlt(java.lang.String alt)
           
 void setCaption(java.lang.String caption)
           
 void setFilename(java.lang.String filename)
           
 void setLink(java.lang.String link)
           
 void setLocation(java.lang.String location)
           
 void setNamespace(java.lang.String namespace)
           
 void setSize(java.lang.String size)
          Set the size of the image in pixel.
 void setType(java.lang.String type)
           
 void setWidth(int width)
          Set the width of the image in pixel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFormat

public ImageFormat()
Method Detail

getImageFormat

public static ImageFormat getImageFormat(java.lang.String rawImageLink,
                                         java.lang.String imageNamespace)

getAlt

public java.lang.String getAlt()

getCaption

public java.lang.String getCaption()

getFilename

public java.lang.String getFilename()

getLocation

public java.lang.String getLocation()

getNamespace

public java.lang.String getNamespace()

getLink

public java.lang.String getLink()
Get the "e;link="e; attribute from the [[Image:...]] wiki link.

Returns:
the "e;link="e; attribute

getWidth

public int getWidth()
Get the width of the image in pixel (example: "600px")

Parameters:
size -
Returns:
-1 if no width is specified

getWidthStr

public java.lang.String getWidthStr()
Get the width of the image as a string

Parameters:
size -
Returns:
null if no width is specified

getHeight

public int getHeight()
Get the height of the image in pixel (example: "600px")

Parameters:
size -
Returns:
-1 if no width is specified

getHeightStr

public java.lang.String getHeightStr()
Get the height of the image as a string

Parameters:
size -
Returns:
null if no width is specified

getType

public java.lang.String getType()

setAlt

public void setAlt(java.lang.String alt)

setCaption

public void setCaption(java.lang.String caption)

setFilename

public void setFilename(java.lang.String filename)

setLocation

public void setLocation(java.lang.String location)

setNamespace

public void setNamespace(java.lang.String namespace)

setLink

public void setLink(java.lang.String link)

setSize

public void setSize(java.lang.String size)
Set the size of the image in pixel. If the given string ends with "px" additionally calculate the integer value of the width and optionally the size of the height (example: "600px"). If the size is negative ignore it. See Image markup#Size and See Help:Images

Parameters:
size -

setType

public void setType(java.lang.String type)

setWidth

public void setWidth(int width)
Set the width of the image in pixel. This method is typically used to set a "default width" (220px) for images of type "thumb" if no width is set in the image format string.

Parameters:
width -
See Also:
AbstractWikiModel.setDefaultThumbWidth(ImageFormat)


Copyright © 2012 Java Wikipedia API (Bliki engine). All Rights Reserved.