package org.liveontologies.protege.explanation.justification;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.event.ActionListener;
import java.awt.geom.Arc2D;
import java.awt.geom.Area;
import java.awt.geom.GeneralPath;

import org.protege.editor.core.ui.list.MListButton;

public class MListReloadButton extends MListButton {

	private static final int ANGLE_START_ = 10, ANGLE_EXTENT_ = 330;

	private final GeneralPath arrow_ = new GeneralPath(
			GeneralPath.WIND_EVEN_ODD, 6);
	private final Arc2D arcBorder_ = new Arc2D.Float();

	protected MListReloadButton(ActionListener actionListener) {
		super("Reload", Color.BLUE.brighter(), actionListener);
	}

	@Override
	public void paintButtonContent(Graphics2D g) {

		float sizeX = getBounds().width;
		float sizeY = getBounds().height;

		float height = sizeY / 2;
		float width = sizeX / 2;

		float xCenter = getBounds().x + height;
		float yCenter = getBounds().y + width;

		int quarterSize = (Math.round(width / 4.0f) / 2) * 2;

		float radius = (Math.min(width, height) - quarterSize) / 2;

		double radians = Math.toRadians(ANGLE_START_);
		// the tip of the arrow
		double tipX = xCenter + (radius + quarterSize) * Math.cos(radians);
		double tipY = yCenter - radius * Math.sin(radians);
		float tipWidth = 3 * radius / 2;
		float tipHeight = 3 * radius / 2;

		arrow_.reset();
		arrow_.moveTo(tipX, tipY);
		arrow_.lineTo(tipX - tipWidth, tipY);
		arrow_.lineTo(tipX - tipWidth + quarterSize, tipY - quarterSize);
		arrow_.lineTo(tipX - quarterSize, tipY - quarterSize);
		arrow_.lineTo(tipX - quarterSize, tipY - tipHeight + quarterSize);
		arrow_.lineTo(tipX, tipY - tipHeight);
		arrow_.closePath();
		g.fill(arrow_);
		arcBorder_.setArcByCenter(xCenter, yCenter, radius + quarterSize,
				ANGLE_START_, ANGLE_EXTENT_, Arc2D.PIE);
		Area area = new Area(arcBorder_);
		arcBorder_.setArcByCenter(xCenter, yCenter, radius, ANGLE_START_,
				ANGLE_EXTENT_, Arc2D.PIE);
		area.subtract(new Area(arcBorder_));
		g.fill(area);
	}

}
@@ -56,16 +56,722 @@
 ation;%0A%0A
+/*-%0A * #%25L%0A * Protege Justification Explanation%0A * $Id:$%0A * $HeadURL:$%0A * %25%25%0A * Copyright (C) 2016 - 2017 Live Ontologies Project%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *      http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0A%0A
 import j
@@ -1147,16 +1147,19 @@
 th arrow
+Tip
 _ = new 
@@ -1201,17 +1201,17 @@
 EN_ODD, 
-6
+3
 );%0A%09priv
@@ -2053,16 +2053,19 @@
 %0A%09%09arrow
+Tip
 _.reset(
@@ -2074,16 +2074,19 @@
 %0A%09%09arrow
+Tip
 _.moveTo
@@ -2110,283 +2110,98 @@
 rrow
-_.lineTo(tipX - tipWidth, tipY);%0A%09%09arrow_.lineTo(tipX - tipWidth + quarterSize, tipY - quarterSize);%0A%09%09arrow_.lineTo(tipX - quarterSize, tipY - quarterSize);%0A%09%09arrow_.lineTo(tipX - quarterSize, tipY - tipHeight + quarterSize);%0A%09%09arrow_.lineTo(tipX, tipY - tipHeight);%0A%09%09arrow
+Tip_.lineTo(tipX - tipWidth, tipY);%0A%09%09arrowTip_.lineTo(tipX, tipY - tipHeight);%0A%09%09arrowTip
 _.cl
@@ -2225,16 +2225,19 @@
 ll(arrow
+Tip
 _);%0A%09%09ar

Simplify the reload button