| 1 | /* |
| 2 | * $Id: HPEN.java,v 1.1.1.5 2004/05/25 20:23:24 hastings Exp $ |
| 3 | * |
| 4 | * (c) Copyright, Moebius Solutions, Inc., 2004 |
| 5 | * |
| 6 | * All Rights Reserved |
| 7 | * |
| 8 | * This material may be reproduced by or for the U. S. Government |
| 9 | * pursuant to the copyright license under the clause at |
| 10 | * DFARS 252.227-7014 (OCT 2001). |
| 11 | */ |
| 12 | |
| 13 | package com.moesol.bindings.platform_sdk.windows_api; |
| 14 | |
| 15 | /** |
| 16 | * @author Robert Hastings |
| 17 | * |
| 18 | * Expose Win32 HPEN. |
| 19 | */ |
| 20 | public class HPEN extends HGDIOBJ { |
| 21 | |
| 22 | /** |
| 23 | * @param handle |
| 24 | * @param temporary - lead detection is skipped when true |
| 25 | */ |
| 26 | protected HPEN(long handle, boolean temporary) { |
| 27 | super(handle, temporary); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * @param handle |
| 32 | */ |
| 33 | protected HPEN(long handle) { |
| 34 | super(handle); |
| 35 | } |
| 36 | public static HPEN createPen( |
| 37 | int fnPenStyle, // pen style |
| 38 | int nWidth, // pen width |
| 39 | int crColor // pen color |
| 40 | ) { |
| 41 | long r = jni_createPen(fnPenStyle, nWidth, crColor); |
| 42 | if (r == 0) { |
| 43 | throw new RuntimeException("createPen failed"); |
| 44 | } |
| 45 | return new HPEN(r); |
| 46 | } |
| 47 | public static final int PS_SOLID = 0; |
| 48 | public static final int PS_DASH = 1; |
| 49 | public static final int PS_DOT = 2; |
| 50 | public static final int PS_DASHDOT = 3; |
| 51 | public static final int PS_DASHDOTDOT = 4; |
| 52 | public static final int PS_NULL = 5; |
| 53 | public static final int PS_INSIDEFRAME = 6; |
| 54 | |
| 55 | public static final int PS_USERSTYLE = 7; |
| 56 | public static final int PS_ALTERNATE = 8; |
| 57 | public static final int PS_STYLE_MASK = 0x0000000F; |
| 58 | |
| 59 | private static native long jni_createPen(int fnPenStyle, int nWidth, int crColor); |
| 60 | } |