Package com.kakao.vectormap.label
Class LabelStyle
- java.lang.Object
-
- com.kakao.vectormap.internal.ILabelStyle
-
- com.kakao.vectormap.label.LabelStyle
-
public class LabelStyle extends ILabelStyle
Label의 Icon 과 Text 스타일을 설정하는 클래스. ZoomLevel 마다 다르게 스타일을 설정할 수 있다.
-
-
Field Summary
Fields Modifier and Type Field Description floatanchorXfloatanchorYbooleanenableIconTransitionEntrancebooleanenableIconTransitionExitbooleanenableTextTransitionEntrancebooleanenableTextTransitionExitintentranceTransitionintexitTransitionintgravityBitmapiconBitmapinticonResIdfloatpaddinginttextEntranceTransitioninttextExitTransition-
Fields inherited from class com.kakao.vectormap.internal.ILabelStyle
applyDpScale, assetId, textStyles, zoomLevel
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuild(IMapResourceManager resourceManager)booleanequals(java.lang.Object o)static LabelStylefrom()LabelStyle 객체를 생성한다.static LabelStylefrom(int iconResId)Icon 이미지를 갖는Label의 스타일 객체를 생성한다.static LabelStylefrom(Bitmap iconBitmap)Icon 이미지를 갖는Label의 스타일 객체를 생성한다.static LabelStylefrom(LabelTextStyle... textStyles)LabelTextStyle 을 가지고 LabelStyle 객체를 생성한다.static LabelStylefrom(Context context, int styleResId)styles.xml 에 미리 정의되어 있는 속성들로 LabelStyle 객체를 생성한다.PointFgetAnchorPoint()anchorPoint 값을 가져온다.PointFgetIconAnchor()icon 의 anchor 값을 가져온다.BitmapgetIconBitmap()Icon 에 설정된 비트맵 이미지를 가져온다.intgetIconResId()Icon 에 설정된 이미지 리소스 Id 를 가져온다.LabelTransitiongetIconTransition()Label 의 icon 에 설정 된 LabelTransition 을 가져온다.floatgetPadding()padding 을 가져온다.intgetTextEntranceTransition()Label 의 텍스트 Entrance LabelTransition 을 가져온다.intgetTextExitTransition()Label 의 텍스트 Exit LabelTransition 을 가져온다.intgetTextGravity()텍스트의 MapGravity 를 가져온다.intgetTextStyleCount()텍스트 스타일의 라인마다 갯수를 가져온다.LabelTextStyle[]getTextStyles()Label 의 텍스트 스타일을 가져온다.LabelTransitiongetTextTransition()intgetZoomLevel()zoomLevel 을 가져온다.inthashCode()booleanisApplyDpScale()dpScale 여부를 가져온다.LabelStylesetAnchorPoint(float x, float y)Label 의 위치 좌표를 기준으로 Icon 이미지를 어떻게 배치(gravity)할 지 설정한다.LabelStylesetAnchorPoint(PointF anchor)Label 의 위치 좌표를 기준으로 Icon 이미지를 어떻게 배치(gravity)할 지 설정한다.LabelStylesetApplyDpScale(boolean applyDpScale)dpScale 을 설정한다.LabelStylesetIconTransition(LabelTransition transition)Label이 지도에 나타나고 사라질 때 적용하는 애니메이션을 설정한다.LabelStylesetPadding(float padding)padding 을 설정한다.LabelStylesetTextGravity(int gravity)텍스트의 MapGravity 를 설정한다.LabelStylesetTextStyles(int size, int color)텍스트 크기(size) 와 색깔(color) 로 Label 의 텍스트 스타일을 설정한다.LabelStylesetTextStyles(int size, int color, int strokeSize, int strokeColor)텍스트 크기(size), 색깔(color), 테두리 굵기(strokeSize) 와 테두리 색깔(strokeColor) 로 Label 의 텍스트 스타일을 설정한다.LabelStylesetTextStyles(LabelTextStyle... textStyles)Label 텍스트 스타일을 설정한다.LabelStylesetTextTransition(LabelTransition transition)Label의 텍스트가 지도에 나타나고 사라질 때 적용하는 애니메이션을 설정한다.LabelStylesetZoomLevel(int zoomLevel)LabelStyle 이 적용될 zoomLevel 을 설정한다.
-
-
-
Field Detail
-
iconResId
public int iconResId
-
iconBitmap
public Bitmap iconBitmap
-
padding
public float padding
-
anchorX
public float anchorX
-
anchorY
public float anchorY
-
exitTransition
public int exitTransition
-
entranceTransition
public int entranceTransition
-
textExitTransition
public int textExitTransition
-
textEntranceTransition
public int textEntranceTransition
-
enableIconTransitionEntrance
public boolean enableIconTransitionEntrance
-
enableIconTransitionExit
public boolean enableIconTransitionExit
-
enableTextTransitionEntrance
public boolean enableTextTransitionEntrance
-
enableTextTransitionExit
public boolean enableTextTransitionExit
-
gravity
public int gravity
-
-
Method Detail
-
from
public static LabelStyle from()
LabelStyle 객체를 생성한다.
-
from
public static LabelStyle from(int iconResId)
Icon 이미지를 갖는Label의 스타일 객체를 생성한다.- Parameters:
iconResId- res/drawable 디렉토리에 저장되어 있는 이미지 resourceId. (예: R.drawable.chicken) 기기의 픽셀밀도 구분이 필요없다. 원본 이미지를 가지고 지도 내부적으로 이미지 크기 계산을 한다.
-
from
public static LabelStyle from(Bitmap iconBitmap)
Icon 이미지를 갖는Label의 스타일 객체를 생성한다. 시스템이 제공하는 픽셀밀도 별 res/drawable 에 있는 이미지를 bitmap 으로 변환할 때는 디렉토리 구분에 따라 크기가 달라진다.- Parameters:
iconBitmap- Icon 에 넣고자 하는 Bitmap 이미지
-
from
public static LabelStyle from(LabelTextStyle... textStyles)
LabelTextStyle 을 가지고 LabelStyle 객체를 생성한다.- Parameters:
textStyles- Label 의 텍스트에 적용 할 텍스트 스타일 정의하는 파라미터.
-
from
public static LabelStyle from(Context context, int styleResId)
styles.xml 에 미리 정의되어 있는 속성들로 LabelStyle 객체를 생성한다.- Parameters:
context-styleResId- LabelStyle 이 정의 되어 있는 styles 리소스 id.
-
setPadding
public LabelStyle setPadding(float padding)
padding 을 설정한다.- Parameters:
padding- padding 값 (px).
-
setApplyDpScale
public LabelStyle setApplyDpScale(boolean applyDpScale)
dpScale 을 설정한다.- Parameters:
applyDpScale- dpScale 적용 여부.
-
setAnchorPoint
public LabelStyle setAnchorPoint(PointF anchor)
Label 의 위치 좌표를 기준으로 Icon 이미지를 어떻게 배치(gravity)할 지 설정한다. 이미지의 가로와 세로 크기를 1.0 으로 기준.- Parameters:
anchor- anchor 값.
-
setAnchorPoint
public LabelStyle setAnchorPoint(float x, float y)
Label 의 위치 좌표를 기준으로 Icon 이미지를 어떻게 배치(gravity)할 지 설정한다. 이미지의 가로와 세로 크기를 1.0 로 기준.- Parameters:
x- anchor 의 x 값.y- anchor 의 y 값.
-
setZoomLevel
public LabelStyle setZoomLevel(int zoomLevel)
LabelStyle 이 적용될 zoomLevel 을 설정한다.- Parameters:
zoomLevel- 적용 할 최소 zoomLevel 값.
-
setTextStyles
public LabelStyle setTextStyles(LabelTextStyle... textStyles)
Label 텍스트 스타일을 설정한다. 추가 된LabelTextStyle의 순서대로 하나의 라인의 텍스트 스타일을 정의한다.- Parameters:
textStyles- Label 의 텍스트에 적용 할 스타일 정의하는 클래스.
-
setTextStyles
public LabelStyle setTextStyles(int size, int color)
텍스트 크기(size) 와 색깔(color) 로 Label 의 텍스트 스타일을 설정한다.- Parameters:
size- 텍스트 크기 (px).color- 텍스트 색깔.
-
setTextStyles
public LabelStyle setTextStyles(int size, int color, int strokeSize, int strokeColor)
텍스트 크기(size), 색깔(color), 테두리 굵기(strokeSize) 와 테두리 색깔(strokeColor) 로 Label 의 텍스트 스타일을 설정한다.- Parameters:
size- 텍스트 크기 (px).color- 텍스트 색깔.strokeSize- 텍스트 테두리의 굵기 (px).strokeColor- 텍스트 테두리의 색깔.
-
setIconTransition
public LabelStyle setIconTransition(LabelTransition transition)
Label이 지도에 나타나고 사라질 때 적용하는 애니메이션을 설정한다.- Parameters:
transition- Label 이 나타나고 사라질 때 애니메이션을 정의하는 파라미터.
-
setTextTransition
public LabelStyle setTextTransition(LabelTransition transition)
Label의 텍스트가 지도에 나타나고 사라질 때 적용하는 애니메이션을 설정한다.- Parameters:
transition- Label 의 텍스트가 나타나고 사라질 때 애니메이션을 정의하는 파라미터.
-
getTextEntranceTransition
public int getTextEntranceTransition()
Label 의 텍스트 Entrance LabelTransition 을 가져온다.
-
getTextExitTransition
public int getTextExitTransition()
Label 의 텍스트 Exit LabelTransition 을 가져온다.
-
getZoomLevel
public int getZoomLevel()
zoomLevel 을 가져온다.
-
getPadding
public float getPadding()
padding 을 가져온다.
-
getIconAnchor
public PointF getIconAnchor()
icon 의 anchor 값을 가져온다.
-
getIconTransition
public LabelTransition getIconTransition()
Label 의 icon 에 설정 된 LabelTransition 을 가져온다.
-
getTextTransition
public LabelTransition getTextTransition()
-
getTextStyles
public LabelTextStyle[] getTextStyles()
Label 의 텍스트 스타일을 가져온다.
-
getTextStyleCount
public int getTextStyleCount()
텍스트 스타일의 라인마다 갯수를 가져온다.
-
isApplyDpScale
public boolean isApplyDpScale()
dpScale 여부를 가져온다.
-
build
public void build(IMapResourceManager resourceManager)
-
setTextGravity
public LabelStyle setTextGravity(int gravity)
텍스트의 MapGravity 를 설정한다.- Parameters:
gravity- 배치를 위한 기준이 되는 상수.
-
getTextGravity
public int getTextGravity()
텍스트의 MapGravity 를 가져온다.
-
getIconResId
public int getIconResId()
Icon 에 설정된 이미지 리소스 Id 를 가져온다.
-
getIconBitmap
public Bitmap getIconBitmap()
Icon 에 설정된 비트맵 이미지를 가져온다.
-
getAnchorPoint
public PointF getAnchorPoint()
anchorPoint 값을 가져온다.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-