import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
+import org.tizen.emulator.manager.renewal.resources.ColorResources;
public class Hyperlink extends Canvas {
private String text = "";
this.addPaintListener(paintListener);
this.addMouseListener(mouseListener);
this.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ // TODO
+ this.setBackground(ColorResources.BLACK.getColor());
focusBoxColor = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
}
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.widgets.Display;
+import org.tizen.emulator.manager.EmulatorManager;
public class FontResources {
- public static Font COLUMN_FONT = setSizeDefaultFont(12);
- public static Font ITEM_FONT = setSizeDefaultFont(11);
-
- private static boolean isMac = false;
- private static boolean isWin = false;
- private static boolean isLinux = false;
- static {
-
- if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) {
- isLinux = true;
- } else if (System.getProperty("os.name").toLowerCase().indexOf("win") > -1) {
- isWin = true;
- } else if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
- isMac = true;
- }
- }
+ public static Font COLUMN_FONT = setSizeDefaultFont(11);
+ public static Font ITEM_FONT = setSizeDefaultFont(10);
private static Font defaultFont = null;
public static Font getDADefaultFont() {
if (defaultFont == null) {
String fontName = null;
- if (isLinux) {
+ if (EmulatorManager.isLinux()) {
fontName = "Dejavu Sans";
- } else if (isWin) {
+ } else if (EmulatorManager.isWin()) {
fontName = "Verdana";
- } else if (isMac) {
+ } else if (EmulatorManager.isMac()) {
fontName = "Lucida Grande";
} else {
defaultFont = Display.getCurrent().getSystemFont();
return defaultFont;
}
- defaultFont = isMac
+ defaultFont = EmulatorManager.isMac()
? new Font(Display.getCurrent(), new FontData[] { new FontData(fontName, 11, SWT.NORMAL) })
: new Font(Display.getCurrent(), new FontData[] { new FontData(fontName, 9, SWT.NORMAL) });
}
defaultFont = getDADefaultFont();
}
- if (isMac) {
+ if (EmulatorManager.isMac()) {
size = size + 2;
}
defaultFont = getDADefaultFont();
}
- if (isMac) {
+ if (EmulatorManager.isMac()) {
size = size + 2;
}
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.TypedListener;
+import org.tizen.emulator.manager.EmulatorManager;
public class Table extends TableScrolledComposite {
private static final int[] EMPTY_SELECTION = new int[0];
tableColumn = new Composite(table, SWT.None);
- tableItem = new Composite(table, SWT.NONE);
+ tableItem = new Composite(table, SWT.DOUBLE_BUFFERED);
tableItem.setBackground(ColorResources.ITEM_SELECTED_BG_COLOR);
this.setTableItemContent(tableItem);
items = new TableItem[4];
itemCount = 0;
selection = EMPTY_SELECTION;
+ lastSelectedIndex = -1;
if (isCheck) {
checkBox.setSelection(false);
checkBox.setEnabled(false);
for (int i = 0; i < selection.length; i++) {
if (index == selection[i]) {
int length = selection.length;
- int[] newSelection = new int[length - 1];
- System.arraycopy(selection, 0, newSelection, 0, i);
- if (i < length - 1) {
- System.arraycopy(selection, i+1, newSelection, i, length - i - 1);
+ if (length == 1) {
+ selection = EMPTY_SELECTION;
+ } else {
+ int[] newSelection = new int[length - 1];
+ System.arraycopy(selection, 0, newSelection, 0, i);
+ if (i < length - 1) {
+ System.arraycopy(selection, i+1, newSelection, i, length - i - 1);
+ }
+ selection = newSelection;
}
- selection = newSelection;
rearrangeItems(index);
showSelection();
break;
int height = Math.max(tableHeight, rect.height);
table.setSize(width, height);
+ tableColumn.setBounds(0, 0, width, columnHeight);
+ tableItem.setBounds(0, columnHeight, width, height - columnHeight);
+
if (rect.width == width && rect.height == height) {
redraw();
}
- tableColumn.setBounds(0, 0, width, columnHeight);
- tableItem.setBounds(0, columnHeight, width, height - columnHeight);
+
+ if (EmulatorManager.isWin()) {
+ tableColumn.redraw();
+ tableItem.redraw();
+ }
}
public int getColumnHeightSize() {
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
+import org.tizen.emulator.manager.EmulatorManager;
class TableItemData {
String text = "";
gc.setLineWidth(1);
gc.drawLine(width - 1, 0, width - 1, clientArea.height);
}
+
+ @Override
+ public void redraw() {
+ super.redraw();
+ if (!EmulatorManager.isWin()) {
+ return;
+ }
+
+ if (parent.isChecked() && checkBox != null) {
+ checkBox.redraw();
+ }
+
+ if (dataList != null) {
+ for (TableItemData data : dataList) {
+ if (data == null) {
+ continue;
+ }
+ data.itemCanvas.redraw();
+ }
+ }
+ }
}