콘텐츠로 이동

Class ImageComponent

package org.kwis.msp.lwc

java.lang.Object
|
+--org.kwis.msp.lwc.Component
|
+--org.kwis.msp.lwc.ImageComponent

extends Component:

ImageComponent는 이미지데이타를 지정한 정렬형태로 화면에 출력하는 클래스 입니다.

ImageComponentsetLayout(int)를 사용하여 정렬형태를 지정 할 수 있습니다. ImageComponent에서 제공하고 있는 정렬형태는 Component.LAYOUT_LEFTComponent.LAYOUT_RIGHT, Component.LAYOUT_HCENTER,Component.LAYOUT_TOP, Component.LAYOUT_BOTTOM,Component.LAYOUT_HCENTER입니다.

정렬 조합 규칙을 참고하여 각 정렬형태를 조합할 수 있습니다. ImageComponent생성시 정렬 형태는 LAYOUT_LEFT|LAYOUT_TOP로 초기화 됩니다.

See Also:

  • Image
  • protected Image img — 이미지
  • protected String imgStr — 이미지 리소스
  • ImageComponent () 새로운 ImageComponent 의 인스턴스를 생성합니다.
  • ImageComponent ( Image img) 새로운 ImageComponent 의 인스턴스를 생성합니다.
  • ImageComponent ( String str) 새로운 ImageComponent 의 인스턴스를 생성합니다.
  • Image getImage () — ImageComponent 에 설정된 이미지를 얻어옵니다.
  • int getPreferredHeight () — 컴포넌트의 적절한 높이를 결정합니다.
  • int getPreferredHeight (int w) — 컴포넌트의 적절한 높이를 결정합니다.
  • int getPreferredWidth () — 컴포넌트의 적절한 폭을 결정합니다.
  • void paintContent ( Graphics g) — 내부를 칠합니다.
  • void play () — ImageComponent 의 이미지 데이타가 Animation Image 인 경우에 이 함수가 사용될 수 있으며 이미지의 움직임을 시작합니다.
  • void setImage ( Image img) — ImageComponent 에 이미지를 설정합니다.
  • void setImage ( String str) — ImageComponent 에 주어진 이미지 리소스을 가지고 이미지를 생성하여 설정합니다.
  • void setLayout (int layout) — 이미지의 정렬형태를 설정합니다.
  • protected  void showNotify (boolean bShow) — 화면의 내용이 보이면 호출됩니다.
  • void stop () — ImageComponent 의 이미지 데이타가 Animation Image 인 경우에 이 함수가 사용되며, 이미지의 움직임을 멈춥니다.
protected String imgStr
  • 이미지 리소스
protected Image img
  • 이미지
public ImageComponent()
  • 새로운 ImageComponent의 인스턴스를 생성합니다. 이미지 데이타는 null로 초기화 됩니다.
public ImageComponent(Image img)

Parameters:

  • img - 초기값으로 사용할 이미지 혹은 null
public ImageComponent(String str)

Parameters:

  • str - 초기값으로 사용할 이미지의 리소스 혹은 null
public void setImage(Image img)

Parameters:

  • img - 설정할 이미지
public Image getImage()

Returns:

  • 설정된 이미지
public void setImage(String str)

Parameters:

  • str - 자료의 경로명을 지정하는 문자열

Throws:

  • IllegalArgumentException - 자료의 경로명이 null인경우
public void setLayout(int layout)

Parameters:

  • type - Layout Type값.

See Also:

  • Component.LAYOUT_LEFT, Component.LAYOUT_RIGHT, Component.LAYOUT_HCENTER, Component.LAYOUT_TOP, Component.LAYOUT_BOTTOM, Component.LAYOUT_VCENTER
public int getPreferredHeight(int w)
  • Description copied from class: Component

Overrides:

  • getPreferredHeight in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Parameters:

  • w - 가변폭.

Returns:

  • 컴포넌트의 높이.
public int getPreferredHeight()
  • Description copied from class: Component

Overrides:

  • getPreferredHeight in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Returns:

  • 컴포넌트의 높이
public int getPreferredWidth()
  • Description copied from class: Component

Overrides:

  • getPreferredWidth in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Returns:

  • 컴포넌트의 폭.
public void paintContent(Graphics g)
  • Description copied from class: Component

Overrides:

  • paintContent in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Parameters:

  • g - 칠할 Graphics.

See Also:

  • Graphics
protected void showNotify(boolean bShow)
  • Description copied from class: Component

Overrides:

  • showNotify in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Parameters:

  • bShow - 컴포넌트가 나타나는지 안나타나는지 여부
public void play()
  • ImageComponent의 이미지 데이타가 Animation Image 인 경우에 이 함수가 사용될 수 있으며 이미지의 움직임을 시작합니다.
Animation이 진행되는 동안 ImageObserver에 animation 진행 상황을
ImageObserver의 notify()함수를 호출함으로써 알려줍니다.
Animation 이미지가 아닌 경우에 이 함수는 아무런 작업도 하지
않습니다
public void stop()
  • ImageComponent의 이미지 데이타가 Animation Image 인 경우에 이 함수가 사용되며, 이미지의 움직임을 멈춥니다. Animation Image가 아닌 경우에 아무런 작업도 하지 않습니다. 이미지를 더이상 사용하지 않으면 이 함수를 불러서 이미지의 레퍼런스를 없애야 합니다. 그렇지 않으면, 사용하지 않은 이미지 레퍼런스를 가지게 되므로, 메모리를 낭비할 수 있습니다.
public ImageComponent()
  • 새로운 ImageComponent의 인스턴스를 생성합니다. 이미지 데이타는 null로 초기화 됩니다.
public ImageComponent(Image img)

Parameters:

  • img - 초기값으로 사용할 이미지 혹은 null
public ImageComponent(String str)

Parameters:

  • str - 초기값으로 사용할 이미지의 리소스 혹은 null
public void setImage(Image img)

Parameters:

  • img - 설정할 이미지
public Image getImage()

Returns:

  • 설정된 이미지
public void setImage(String str)

Parameters:

  • str - 자료의 경로명을 지정하는 문자열

Throws:

  • IllegalArgumentException - 자료의 경로명이 null인경우
public void setLayout(int layout)

Parameters:

  • type - Layout Type값.

See Also:

  • Component.LAYOUT_LEFT, Component.LAYOUT_RIGHT, Component.LAYOUT_HCENTER, Component.LAYOUT_TOP, Component.LAYOUT_BOTTOM, Component.LAYOUT_VCENTER
public int getPreferredHeight(int w)
  • Description copied from class: Component

Overrides:

  • getPreferredHeight in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Parameters:

  • w - 가변폭.

Returns:

  • 컴포넌트의 높이.
public int getPreferredHeight()
  • Description copied from class: Component

Overrides:

  • getPreferredHeight in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Returns:

  • 컴포넌트의 높이
public int getPreferredWidth()
  • Description copied from class: Component

Overrides:

  • getPreferredWidth in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Returns:

  • 컴포넌트의 폭.
public void paintContent(Graphics g)
  • Description copied from class: Component

Overrides:

  • paintContent in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Parameters:

  • g - 칠할 Graphics.

See Also:

  • Graphics
protected void showNotify(boolean bShow)
  • Description copied from class: Component

Overrides:

  • showNotify in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Parameters:

  • bShow - 컴포넌트가 나타나는지 안나타나는지 여부
public void play()
  • ImageComponent의 이미지 데이타가 Animation Image 인 경우에 이 함수가 사용될 수 있으며 이미지의 움직임을 시작합니다.
Animation이 진행되는 동안 ImageObserver에 animation 진행 상황을
ImageObserver의 notify()함수를 호출함으로써 알려줍니다.
Animation 이미지가 아닌 경우에 이 함수는 아무런 작업도 하지
않습니다
public void stop()
  • ImageComponent의 이미지 데이타가 Animation Image 인 경우에 이 함수가 사용되며, 이미지의 움직임을 멈춥니다. Animation Image가 아닌 경우에 아무런 작업도 하지 않습니다. 이미지를 더이상 사용하지 않으면 이 함수를 불러서 이미지의 레퍼런스를 없애야 합니다. 그렇지 않으면, 사용하지 않은 이미지 레퍼런스를 가지게 되므로, 메모리를 낭비할 수 있습니다.
public void setImage(Image img)

Parameters:

  • img - 설정할 이미지
public Image getImage()

Returns:

  • 설정된 이미지
public void setImage(String str)

Parameters:

  • str - 자료의 경로명을 지정하는 문자열

Throws:

  • IllegalArgumentException - 자료의 경로명이 null인경우
public void setLayout(int layout)

Parameters:

  • type - Layout Type값.

See Also:

  • Component.LAYOUT_LEFT, Component.LAYOUT_RIGHT, Component.LAYOUT_HCENTER, Component.LAYOUT_TOP, Component.LAYOUT_BOTTOM, Component.LAYOUT_VCENTER
public int getPreferredHeight(int w)
  • Description copied from class: Component

Overrides:

  • getPreferredHeight in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Parameters:

  • w - 가변폭.

Returns:

  • 컴포넌트의 높이.
public int getPreferredHeight()
  • Description copied from class: Component

Overrides:

  • getPreferredHeight in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Returns:

  • 컴포넌트의 높이
public int getPreferredWidth()
  • Description copied from class: Component

Overrides:

  • getPreferredWidth in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Returns:

  • 컴포넌트의 폭.
public void paintContent(Graphics g)
  • Description copied from class: Component

Overrides:

  • paintContent in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Parameters:

  • g - 칠할 Graphics.

See Also:

  • Graphics
protected void showNotify(boolean bShow)
  • Description copied from class: Component

Overrides:

  • showNotify in class Component
  • Following copied from class: org.kwis.msp.lwc.Component

Parameters:

  • bShow - 컴포넌트가 나타나는지 안나타나는지 여부
public void play()
  • ImageComponent의 이미지 데이타가 Animation Image 인 경우에 이 함수가 사용될 수 있으며 이미지의 움직임을 시작합니다.
Animation이 진행되는 동안 ImageObserver에 animation 진행 상황을
ImageObserver의 notify()함수를 호출함으로써 알려줍니다.
Animation 이미지가 아닌 경우에 이 함수는 아무런 작업도 하지
않습니다
public void stop()
  • ImageComponent의 이미지 데이타가 Animation Image 인 경우에 이 함수가 사용되며, 이미지의 움직임을 멈춥니다. Animation Image가 아닌 경우에 아무런 작업도 하지 않습니다. 이미지를 더이상 사용하지 않으면 이 함수를 불러서 이미지의 레퍼런스를 없애야 합니다. 그렇지 않으면, 사용하지 않은 이미지 레퍼런스를 가지게 되므로, 메모리를 낭비할 수 있습니다.