Posted title : 태그 : translateY
2009/01/26   [JavaFX] translateX, translateY
Posted
2009년 01월 26일 Posted title : [JavaFX] translateX, translateY

http://weblogs.java.net/blog/aim/archive/2009/01/layout_primer_f.html

 

상위 노드를 기준으로 상대적으로 원점을 translateX, translateY만큼 이동

 

 

Example 1: Let's look further at these bounds variables using a concrete code example which creates a rectangle.
rectangle1.png
Note that x and y are variables specific to javafx.scene.shape.Rectangle and that they position the rectangle within its own coordinate space rather than moving the entire coordinate space of the node. I throw this out as the first example because it is often the first thing that trips up developers coming from traditional toolkits such as Swing, where changing x,y effectively performs a translation of the component's coordinate space. All of the javafx.scene.shape classes have variables for specifying appropriate shape geometry within their local coordinate space (e.g. Rectangle has x, y, width, height, Circle has centerX, centerY, radius, etc) and such position variables should not be confused with a translation on the coordinate space, as we'll look at in our next example.


Example 2: To translate the rectangle along with its coordinate space (rather than move the rectangle within it), we instead set translateX/translateY, which are variables on Node.
rectangle2.png
Now boundsInParent has changed to reflect the translated rectangle, however boundsInLocal and layoutBounds remain unchanged because they are relative to the rectangle's coordinate space, which was what was shifted.

inside design note: we debated endlessly on whether to rename translateX,translateY to "x","y" (as it's less typing and more familiar to traditional toolkit programming), however we decided that "translate" was more descriptive in the 2D sense and keeping it avoided renaming the x,y position variables in some shape classes.

Posted by 지니랜드 | 2009/01/26 21:12 | 자바 | 트랙백
◀ 이전 페이지 다음 페이지 ▶



지니랜드
by 지니랜드
카테고리
전체
프로그래밍
자바
- 이클립스
- 기타언어 (ruby, php)
웹기술 HTML javascript
컴퓨터
- Unix/Linux
- spring
- 테스팅
툴 프로그램 설치
- 버전관리
영어
동영상
영화 책
일상
여행
아무거나
재테크
펀드
미분류
이글루링크
소스코드위를 걷다.....
life logging
거북거북 월드 (ㅡ.-..
아직 열지 않은 선물
All about IT Trends
까먹지말자!
이규영 연예영화 블로그
ok_code 블러그
최근 등록된 덧글
카테고리별로 해당되는 ..
by 지니랜드 at 05/22
이 책들을 다 보면... ..
by 랑우 at 04/14
오지천사님 좋은 정보 ..
by 지니랜드 at 03/16
잠깐지나가다가 들렀습니..
by 오지천사 at 03/09
이런 우연이 ㅎㅎㅎ, 저도..
by 지니랜드 at 03/01
저랑 2개나 같이 들으셨군..
by 상욱 at 03/01
아 그러셨구나.. 오늘 못..
by 지니랜드 at 02/28
ㅎㅎㅎ JCO 오시나 보군요..
by 윤걸 at 02/26
좋은지적 감사드립니다.
by 지니짱 at 09/24
멋진데요? 잘보겠습니다.
by coffeejava at 08/04
FISH RSS
최근 등록된 트랙백
2009 자바 개발자 컨퍼런..
by cutewebi 희정냥★
도서이벤트 4탄 (통계의..
by Korean Healthlog
『프리젠테이션 젠』출간..
by acornLoft
뉴욕의 프로그래머
by The note of Legendre
[책] 뉴욕의 프로그래머
by lovesera.com: ART o..
[행사] 매쉬업 컨퍼런..
by lovesera.com: ART o..
[행사] 매쉬업 엑스..
by lovesera.com: ART o..
루비(Ruby) 설치 및..
by Happy egoist
개발시에 참고하자.. /..
by mcsong's languid aft..
이글루 파인더
라이프로그
프리젠테이션 젠
프리젠테이션 젠

초난감 기업의 조건
초난감 기업의 조건

Stick 스틱!
Stick 스틱!

당신의 기업을 시작하라
당신의 기업을 시작하라

테스트 주도 개발
테스트 주도 개발

조엘 온 소프트웨어
조엘 온 소프트웨어

Head First Design Patterns (Paperback)
Head First Design Patterns (Paperback)

실용예제로 배우는 웹 표준
실용예제로 배우는 웹 표준

아랑은 왜
아랑은 왜

천년전의 글로벌 CEO, 해상왕 장보고
천년전의 글로벌 CEO, 해상왕 장보고

마케팅 천재가 된 맥스
마케팅 천재가 된 맥스

태그
javafx java 이벤트 google 크롬OS 제10회한국자바개발자컨퍼런스 유틸 commandpattern xDBA 자바 cut underscore space chromeos 한빛미디어 추리소설 db 파일다운로드 JCO hangulime 할인 디자인패턴 에도가와란포 영진출판사 트위터 dodreams 10회JCO컨퍼런스후기 JCO10THCONFERENCE 로드맵 커맨드패턴
rss

skin by 에셈