当前位置: 首页>>代码示例>>Java>>正文


Java NotePadMeta.getLocation方法代码示例

本文整理汇总了Java中org.pentaho.di.core.NotePadMeta.getLocation方法的典型用法代码示例。如果您正苦于以下问题:Java NotePadMeta.getLocation方法的具体用法?Java NotePadMeta.getLocation怎么用?Java NotePadMeta.getLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.core.NotePadMeta的用法示例。


在下文中一共展示了NotePadMeta.getLocation方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNote

import org.pentaho.di.core.NotePadMeta; //导入方法依赖的package包/类
/**
 * Find the note that is located on a certain point on the canvas.
 *
 * @param x the x-coordinate of the point queried
 * @param y the y-coordinate of the point queried
 * @return The note information if a note is located at the point. Otherwise, if nothing was found: null.
 */
public NotePadMeta getNote(int x, int y)
{
    int i, s;
    s = notes.size();
    for (i = s - 1; i >= 0; i--) // Back to front because drawing goes from start to end
    {
        NotePadMeta ni = notes.get(i);
        Point loc = ni.getLocation();
        Point p = new Point(loc.x, loc.y);
        if (x >= p.x && x <= p.x + ni.width + 2 * Const.NOTE_MARGIN && y >= p.y && y <= p.y + ni.height + 2 * Const.NOTE_MARGIN) { return ni; }
    }
    return null;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:21,代码来源:TransMeta.java

示例2: getNote

import org.pentaho.di.core.NotePadMeta; //导入方法依赖的package包/类
public NotePadMeta getNote(int x, int y) {
	int i, s;
	s = notes.size();
	for (i = s - 1; i >= 0; i--) // Back to front because drawing goes
									// from start to end
	{
		NotePadMeta ni = notes.get(i);
		Point loc = ni.getLocation();
		Point p = new Point(loc.x, loc.y);
		if (x >= p.x && x <= p.x + ni.width + 2 * Const.NOTE_MARGIN && y >= p.y
				&& y <= p.y + ni.height + 2 * Const.NOTE_MARGIN) {
			return ni;
		}
	}
	return null;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:JobMeta.java

示例3: selectInRect

import org.pentaho.di.core.NotePadMeta; //导入方法依赖的package包/类
public void selectInRect(JobMeta jobMeta, org.pentaho.di.core.gui.Rectangle rect) {
  int i;
  for (i = 0; i < jobMeta.nrJobEntries(); i++) {
    JobEntryCopy je = jobMeta.getJobEntry(i);
    Point p = je.getLocation();
    if (((p.x >= rect.x && p.x <= rect.x + rect.width) || (p.x >= rect.x + rect.width && p.x <= rect.x))
        && ((p.y >= rect.y && p.y <= rect.y + rect.height) || (p.y >= rect.y + rect.height && p.y <= rect.y)))
      je.setSelected(true);
  }
  for (i = 0; i < jobMeta.nrNotes(); i++) {
    NotePadMeta ni = jobMeta.getNote(i);
    Point a = ni.getLocation();
    Point b = new Point(a.x + ni.width, a.y + ni.height);
    if (rect.contains(a.x, a.y) && rect.contains(b.x, b.y))
      ni.setSelected(true);
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:JobGraph.java

示例4: getSelectedNoteLocations

import org.pentaho.di.core.NotePadMeta; //导入方法依赖的package包/类
/**
 * Get an array of all the selected step and note locations
 *
 * @return The selected step and notes locations.
 */
public Point[] getSelectedNoteLocations()
{
    List<Point> points = new ArrayList<Point>();

    for (int i = 0; i < nrSelectedNotes(); i++)
    {
        NotePadMeta ni = getSelectedNote(i);
        Point p = ni.getLocation();
        points.add(new Point(p.x, p.y)); // explicit copy of location
    }

    return points.toArray(new Point[points.size()]);
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:TransMeta.java

示例5: drawNote

import org.pentaho.di.core.NotePadMeta; //导入方法依赖的package包/类
protected void drawNote(GC gc, NotePadMeta ni) {
  int flags = SWT.DRAW_DELIMITER | SWT.DRAW_TAB | SWT.DRAW_TRANSPARENT;

  org.eclipse.swt.graphics.Point ext = gc.textExtent(ni.getNote(), flags);
  Point p = new Point(ext.x, ext.y);
  Point loc = ni.getLocation();
  Point note = real2screen(loc.x, loc.y);
  int margin = Const.NOTE_MARGIN;
  p.x += 2 * margin;
  p.y += 2 * margin;
  int width = ni.width;
  int height = ni.height;
  if (p.x > width)
    width = p.x;
  if (p.y > height)
    height = p.y;

  int noteshape[] = new int[] { note.x, note.y, // Top left
      note.x + width + 2 * margin, note.y, // Top right
      note.x + width + 2 * margin, note.y + height, // bottom right 1
      note.x + width, note.y + height + 2 * margin, // bottom right 2
      note.x + width, note.y + height, // bottom right 3
      note.x + width + 2 * margin, note.y + height, // bottom right 1
      note.x + width, note.y + height + 2 * margin, // bottom right 2
      note.x, note.y + height + 2 * margin // bottom left
  };

  gc.setForeground(GUIResource.getInstance().getColorDarkGray());
  gc.setBackground(GUIResource.getInstance().getColorYellow());

  gc.fillPolygon(noteshape);
  gc.drawPolygon(noteshape);
  gc.setForeground(GUIResource.getInstance().getColorBlack());
  gc.drawText(ni.getNote(), note.x + margin, note.y + margin, flags);

  ni.width = width; // Save for the "mouse" later on...
  ni.height = height;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:39,代码来源:JobGraph.java

示例6: getSelectedNoteLocations

import org.pentaho.di.core.NotePadMeta; //导入方法依赖的package包/类
/**
 * Get all the selected note locations
 *
 * @return The selected step and notes locations.
 */
public Point[] getSelectedNoteLocations()
{
    List<Point> points = new ArrayList<Point>();

    for (NotePadMeta ni : getSelectedNotes())
    {
        Point p = ni.getLocation();
        points.add(new Point(p.x, p.y)); // explicit copy of location
    }

    return points.toArray(new Point[points.size()]);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:JobMeta.java

示例7: saveNotePadMeta

import org.pentaho.di.core.NotePadMeta; //导入方法依赖的package包/类
/**
 * 
 * @param rep
 * @param id_transformation
 * @throws KettleException
 */
public void saveNotePadMeta(NotePadMeta note, ObjectId id_transformation) throws KettleException {
	try {
		Point location = note.getLocation();
		int x = location == null ? -1 : location.x;
		int y = location == null ? -1 : location.y;

		// Insert new Note in repository
		note.setObjectId(insertNote(note.getNote(), x, y, note.getWidth(), note.getHeight(), note.getFontName(), note.getFontSize(), note.isFontBold(), note.isFontItalic(), note.getFontColorRed(), note.getFontColorGreen(), note
				.getFontColorBlue(), note.getBackGroundColorRed(), note.getBackGroundColorGreen(), note.getBackGroundColorBlue(), note.getBorderColorRed(), note.getBorderColorGreen(), note.getBorderColorBlue(), note.isDrawShadow()));
	} catch (KettleDatabaseException dbe) {
		throw new KettleException("Unable to save notepad in repository (id_transformation=" + id_transformation + ")", dbe);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:20,代码来源:KettleDatabaseRepositoryNotePadDelegate.java

示例8: getSelectedNoteLocations

import org.pentaho.di.core.NotePadMeta; //导入方法依赖的package包/类
/**
 * Get an array of all the selected step and note locations
 *
 * @return The selected step and notes locations.
 */
public Point[] getSelectedNoteLocations()
{
    List<Point> points = new ArrayList<Point>();

    for (NotePadMeta ni : getSelectedNotes())
    {
        Point p = ni.getLocation();
        points.add(new Point(p.x, p.y)); // explicit copy of location
    }

    return points.toArray(new Point[points.size()]);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:TransMeta.java

示例9: drawNote

import org.pentaho.di.core.NotePadMeta; //导入方法依赖的package包/类
private void drawNote(GC gc, NotePadMeta notePadMeta)
{
    int flags = SWT.DRAW_DELIMITER | SWT.DRAW_TAB | SWT.DRAW_TRANSPARENT;

    if (notePadMeta.isSelected()) gc.setLineWidth(2); else gc.setLineWidth(1);
    
    org.eclipse.swt.graphics.Point ext;
    if (Const.isEmpty(notePadMeta.getNote()))
    {
        ext = new org.eclipse.swt.graphics.Point(10,10); // Empty note
    }
    else
    {
        ext = gc.textExtent(notePadMeta.getNote(), flags);
    }
    Point p = new Point(ext.x, ext.y);
    Point loc = notePadMeta.getLocation();
    Point note = real2screen(loc.x, loc.y, offset);
    int margin = Const.NOTE_MARGIN;
    p.x += 2 * margin;
    p.y += 2 * margin;
    int width = notePadMeta.width;
    int height = notePadMeta.height;
    if (p.x > width) width = p.x;
    if (p.y > height) height = p.y;

    int noteshape[] = new int[] { note.x, note.y, // Top left
            note.x + width + 2 * margin, note.y, // Top right
            note.x + width + 2 * margin, note.y + height, // bottom right 1
            note.x + width, note.y + height + 2 * margin, // bottom right 2
            note.x + width, note.y + height, // bottom right 3
            note.x + width + 2 * margin, note.y + height, // bottom right 1
            note.x + width, note.y + height + 2 * margin, // bottom right 2
            note.x, note.y + height + 2 * margin // bottom left
    };

    gc.setForeground(darkGray);
    gc.setBackground(yellow);

    gc.fillPolygon(noteshape);
    gc.drawPolygon(noteshape);
    
    gc.setForeground(black);
    if ( !Const.isEmpty(notePadMeta.getNote()) )
    {
        gc.drawText(notePadMeta.getNote(), note.x + margin, note.y + margin, flags);
    }

    notePadMeta.width = width; // Save for the "mouse" later on...
    notePadMeta.height = height;

    if (notePadMeta.isSelected()) gc.setLineWidth(1); else gc.setLineWidth(2);
    
    // Add to the list of areas...
    //
    if (!shadow) {
    	areaOwners.add(new AreaOwner(note.x, note.y, width, height, transMeta, notePadMeta));
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:60,代码来源:TransPainter.java


注:本文中的org.pentaho.di.core.NotePadMeta.getLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。