Commit bb08f336 authored by mak28ma's avatar mak28ma
Browse files

update of the showcase

parent a4177766
Pipeline #4395 passed with stage
in 2 minutes and 7 seconds
......@@ -614,9 +614,10 @@ public class ATHENEditorWidget extends Canvas {
vBar.setSelection(0);
topLineOffset = 0;
}
}
else if(height<getBounds().height){
vBar.setVisible(false);
} else if (height < getBounds().height) {
if (vBar != null) {
vBar.setVisible(false);
}
}
// update the horizontal scrollbar
......@@ -657,17 +658,18 @@ public class ATHENEditorWidget extends Canvas {
// offscreen rendering
Image imOff = null;
if(useWrap){
//if we use wrap, the image needs to be of the size as the clientarea
if (useWrap) {
// if we use wrap, the image needs to be of the size as the
// clientarea
imOff = new Image(Display.getCurrent(), getClientArea());
} else {
// if we do not use wrap, we render the whole width!!
imOff = new Image(Display.getCurrent(),
new Rectangle(getBounds().x, getBounds().y,
(hBar == null) ? getClientArea().width : hBar.getMaximum() + getClientArea().width,
getClientArea().height));
}
else{
//if we do not use wrap, we render the whole width!!
imOff = new Image(Display.getCurrent(), new Rectangle(getBounds().x, getBounds().y,
(hBar == null) ? getClientArea().width : hBar.getMaximum() + getClientArea().width,
getClientArea().height));
}
GC gcOff = new GC(imOff);
gcOff.setFont(getFont());
......@@ -687,7 +689,7 @@ public class ATHENEditorWidget extends Canvas {
// create a snippet from the image - this can easily be sped up by
// saving the last image and only recreating it if something was
// clicked
//TODO please verify if this stretches the image at some point
// TODO please verify if this stretches the image at some point
gc.drawImage(imOff, Math.min(leftMostPosition, imOff.getBounds().width - getClientArea().width), 0,
getClientArea().width, imOff.getBounds().height, 0, 0, getClientArea().width,
getClientArea().height);
......@@ -1068,30 +1070,30 @@ public class ATHENEditorWidget extends Canvas {
}
//sometimes, when the line is extremely long the result of the gc is not correct!
//see Bug 517015
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=517015
// sometimes, when the line is extremely long the result of the gc is not
// correct!
// see Bug 517015
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=517015
private Point measureLineWidthInPixel(GC gc, String prelimLine) {
//if the line is too long, this seems to fail
if(prelimLine.length()<10000){
// if the line is too long, this seems to fail
if (prelimLine.length() < 10000) {
return gc.textExtent(prelimLine);
}
//if it is longer we need to measure it in steps
// if it is longer we need to measure it in steps
Point maxBounds = new Point(0, 0);
for(int i=0;i<prelimLine.length();i+=10000){
for (int i = 0; i < prelimLine.length(); i += 10000) {
String snippet = prelimLine.substring(i, Math.min(prelimLine.length(), i + 10000));
//measure the snippet
// measure the snippet
Point textExtent = gc.textExtent(snippet);
//update the bouds
maxBounds.y=Math.max(textExtent.y, maxBounds.y);
maxBounds.x+=textExtent.x;
// update the bouds
maxBounds.y = Math.max(textExtent.y, maxBounds.y);
maxBounds.x += textExtent.x;
}
return maxBounds;
}
......@@ -1149,7 +1151,7 @@ public class ATHENEditorWidget extends Canvas {
setSelection(new Point(from, from + length));
}
//TODO this should be private
// TODO this should be private
public void setSelection(Point point) {
this.selection = point;
......@@ -1424,16 +1426,16 @@ public class ATHENEditorWidget extends Canvas {
public List<EditorLine> getEditorLines() {
return editorLines;
}
@Override
public void layout () {
public void layout() {
super.layout();
drawWidget();
}
@Override
public void update(){
public void update() {
super.update();
drawWidget();
}
......
......@@ -414,7 +414,6 @@ public abstract class AEditorSubordinateViewPart implements IPerspectiveDecouple
}
public void onEditorStyleChanged(Event arg0) {
// TODO Auto-generated method stub
}
......
......@@ -14,7 +14,6 @@ public class CorefViewParameterlessFunction extends BrowserFunction {
super(browser, name);
this.runnable = r;
this.functionName = name;
System.out.println(name);
}
public Object function(Object[] args) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment