Class ImageComponent
package org.kwis.msp.lwc
java.lang.Object | +--org.kwis.msp.lwc.Component | +--org.kwis.msp.lwc.ImageComponentextends Component:
ImageComponent는 이미지데이타를 지정한 정렬형태로 화면에 출력하는
클래스 입니다.
ImageComponent는 setLayout(int)를 사용하여 정렬형태를 지정
할 수 있습니다.
ImageComponent에서 제공하고 있는 정렬형태는
Component.LAYOUT_LEFT와 Component.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 인 경우에 이 함수가 사용되며, 이미지의 움직임을 멈춥니다.
필드 상세
섹션 제목: “필드 상세”imgStr
섹션 제목: “imgStr”protected String imgStr- 이미지 리소스
img
섹션 제목: “img”protected Image img- 이미지
ImageComponent
섹션 제목: “ImageComponent”public ImageComponent()- 새로운
ImageComponent의 인스턴스를 생성합니다. 이미지 데이타는null로 초기화 됩니다.
ImageComponent
섹션 제목: “ImageComponent”public ImageComponent(Image img)Parameters:
img- 초기값으로 사용할 이미지 혹은null
ImageComponent
섹션 제목: “ImageComponent”public ImageComponent(String str)Parameters:
str- 초기값으로 사용할 이미지의 리소스 혹은null
setImage
섹션 제목: “setImage”public void setImage(Image img)Parameters:
img- 설정할 이미지
getImage
섹션 제목: “getImage”public Image getImage()Returns:
- 설정된 이미지
setImage
섹션 제목: “setImage”public void setImage(String str)Parameters:
str- 자료의 경로명을 지정하는 문자열
Throws:
IllegalArgumentException- 자료의 경로명이 null인경우
setLayout
섹션 제목: “setLayout”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
getPreferredHeight
섹션 제목: “getPreferredHeight”public int getPreferredHeight(int w)- Description copied from class:
Component
Overrides:
getPreferredHeightin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Parameters:
w- 가변폭.
Returns:
- 컴포넌트의 높이.
getPreferredHeight
섹션 제목: “getPreferredHeight”public int getPreferredHeight()- Description copied from class:
Component
Overrides:
getPreferredHeightin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Returns:
- 컴포넌트의 높이
getPreferredWidth
섹션 제목: “getPreferredWidth”public int getPreferredWidth()- Description copied from class:
Component
Overrides:
getPreferredWidthin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Returns:
- 컴포넌트의 폭.
paintContent
섹션 제목: “paintContent”public void paintContent(Graphics g)- Description copied from class:
Component
Overrides:
paintContentin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Parameters:
g- 칠할 Graphics.
See Also:
Graphics
showNotify
섹션 제목: “showNotify”protected void showNotify(boolean bShow)- Description copied from class:
Component
Overrides:
showNotifyin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Parameters:
bShow- 컴포넌트가 나타나는지 안나타나는지 여부
play
섹션 제목: “play”public void play()ImageComponent의 이미지 데이타가Animation Image인 경우에 이 함수가 사용될 수 있으며 이미지의 움직임을 시작합니다.
Animation이 진행되는 동안 ImageObserver에 animation 진행 상황을 ImageObserver의 notify()함수를 호출함으로써 알려줍니다. Animation 이미지가 아닌 경우에 이 함수는 아무런 작업도 하지 않습니다stop
섹션 제목: “stop”public void stop()ImageComponent의 이미지 데이타가Animation Image인 경우에 이 함수가 사용되며, 이미지의 움직임을 멈춥니다.Animation Image가 아닌 경우에 아무런 작업도 하지 않습니다. 이미지를 더이상 사용하지 않으면 이 함수를 불러서 이미지의 레퍼런스를 없애야 합니다. 그렇지 않으면, 사용하지 않은 이미지 레퍼런스를 가지게 되므로, 메모리를 낭비할 수 있습니다.
생성자 상세
섹션 제목: “생성자 상세”ImageComponent
섹션 제목: “ImageComponent”public ImageComponent()- 새로운
ImageComponent의 인스턴스를 생성합니다. 이미지 데이타는null로 초기화 됩니다.
ImageComponent
섹션 제목: “ImageComponent”public ImageComponent(Image img)Parameters:
img- 초기값으로 사용할 이미지 혹은null
ImageComponent
섹션 제목: “ImageComponent”public ImageComponent(String str)Parameters:
str- 초기값으로 사용할 이미지의 리소스 혹은null
setImage
섹션 제목: “setImage”public void setImage(Image img)Parameters:
img- 설정할 이미지
getImage
섹션 제목: “getImage”public Image getImage()Returns:
- 설정된 이미지
setImage
섹션 제목: “setImage”public void setImage(String str)Parameters:
str- 자료의 경로명을 지정하는 문자열
Throws:
IllegalArgumentException- 자료의 경로명이 null인경우
setLayout
섹션 제목: “setLayout”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
getPreferredHeight
섹션 제목: “getPreferredHeight”public int getPreferredHeight(int w)- Description copied from class:
Component
Overrides:
getPreferredHeightin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Parameters:
w- 가변폭.
Returns:
- 컴포넌트의 높이.
getPreferredHeight
섹션 제목: “getPreferredHeight”public int getPreferredHeight()- Description copied from class:
Component
Overrides:
getPreferredHeightin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Returns:
- 컴포넌트의 높이
getPreferredWidth
섹션 제목: “getPreferredWidth”public int getPreferredWidth()- Description copied from class:
Component
Overrides:
getPreferredWidthin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Returns:
- 컴포넌트의 폭.
paintContent
섹션 제목: “paintContent”public void paintContent(Graphics g)- Description copied from class:
Component
Overrides:
paintContentin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Parameters:
g- 칠할 Graphics.
See Also:
Graphics
showNotify
섹션 제목: “showNotify”protected void showNotify(boolean bShow)- Description copied from class:
Component
Overrides:
showNotifyin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Parameters:
bShow- 컴포넌트가 나타나는지 안나타나는지 여부
play
섹션 제목: “play”public void play()ImageComponent의 이미지 데이타가Animation Image인 경우에 이 함수가 사용될 수 있으며 이미지의 움직임을 시작합니다.
Animation이 진행되는 동안 ImageObserver에 animation 진행 상황을 ImageObserver의 notify()함수를 호출함으로써 알려줍니다. Animation 이미지가 아닌 경우에 이 함수는 아무런 작업도 하지 않습니다stop
섹션 제목: “stop”public void stop()ImageComponent의 이미지 데이타가Animation Image인 경우에 이 함수가 사용되며, 이미지의 움직임을 멈춥니다.Animation Image가 아닌 경우에 아무런 작업도 하지 않습니다. 이미지를 더이상 사용하지 않으면 이 함수를 불러서 이미지의 레퍼런스를 없애야 합니다. 그렇지 않으면, 사용하지 않은 이미지 레퍼런스를 가지게 되므로, 메모리를 낭비할 수 있습니다.
메서드 상세
섹션 제목: “메서드 상세”setImage
섹션 제목: “setImage”public void setImage(Image img)Parameters:
img- 설정할 이미지
getImage
섹션 제목: “getImage”public Image getImage()Returns:
- 설정된 이미지
setImage
섹션 제목: “setImage”public void setImage(String str)Parameters:
str- 자료의 경로명을 지정하는 문자열
Throws:
IllegalArgumentException- 자료의 경로명이 null인경우
setLayout
섹션 제목: “setLayout”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
getPreferredHeight
섹션 제목: “getPreferredHeight”public int getPreferredHeight(int w)- Description copied from class:
Component
Overrides:
getPreferredHeightin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Parameters:
w- 가변폭.
Returns:
- 컴포넌트의 높이.
getPreferredHeight
섹션 제목: “getPreferredHeight”public int getPreferredHeight()- Description copied from class:
Component
Overrides:
getPreferredHeightin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Returns:
- 컴포넌트의 높이
getPreferredWidth
섹션 제목: “getPreferredWidth”public int getPreferredWidth()- Description copied from class:
Component
Overrides:
getPreferredWidthin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Returns:
- 컴포넌트의 폭.
paintContent
섹션 제목: “paintContent”public void paintContent(Graphics g)- Description copied from class:
Component
Overrides:
paintContentin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Parameters:
g- 칠할 Graphics.
See Also:
Graphics
showNotify
섹션 제목: “showNotify”protected void showNotify(boolean bShow)- Description copied from class:
Component
Overrides:
showNotifyin classComponent- Following copied from class:
org.kwis.msp.lwc.Component
Parameters:
bShow- 컴포넌트가 나타나는지 안나타나는지 여부
play
섹션 제목: “play”public void play()ImageComponent의 이미지 데이타가Animation Image인 경우에 이 함수가 사용될 수 있으며 이미지의 움직임을 시작합니다.
Animation이 진행되는 동안 ImageObserver에 animation 진행 상황을 ImageObserver의 notify()함수를 호출함으로써 알려줍니다. Animation 이미지가 아닌 경우에 이 함수는 아무런 작업도 하지 않습니다stop
섹션 제목: “stop”public void stop()ImageComponent의 이미지 데이타가Animation Image인 경우에 이 함수가 사용되며, 이미지의 움직임을 멈춥니다.Animation Image가 아닌 경우에 아무런 작업도 하지 않습니다. 이미지를 더이상 사용하지 않으면 이 함수를 불러서 이미지의 레퍼런스를 없애야 합니다. 그렇지 않으면, 사용하지 않은 이미지 레퍼런스를 가지게 되므로, 메모리를 낭비할 수 있습니다.