diff options
Diffstat (limited to 'org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/SquareBullet.java')
-rw-r--r-- | org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/SquareBullet.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/SquareBullet.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/SquareBullet.java new file mode 100644 index 00000000..7b4068b0 --- /dev/null +++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/SquareBullet.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2014 Florian Thienel and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Florian Thienel - initial API and implementation + *******************************************************************************/ +package org.eclipse.vex.core.internal.layout; + +import org.eclipse.vex.core.internal.core.Graphics; +import org.eclipse.vex.core.internal.core.Rectangle; + +/** + * @author Florian Thienel + */ +public class SquareBullet extends Bullet { + + public SquareBullet(final float fontSize) { + super(fontSize); + } + + public void draw(final Graphics g, final int x, final int y) { + g.setLineStyle(Graphics.LINE_SOLID); + g.setLineWidth(1); + g.drawRect(x, y - size - lift, size, size); + } + + public Rectangle getBounds() { + return new Rectangle(0, -size - lift, size, size); + } + +} |