Examples of constrain()


Examples of ae.sun.java2d.SunGraphics2D.constrain()

            Image backBuffer = getBackBuffer();
            if (backBuffer == null) {
                return getGraphics();
            }
            SunGraphics2D g = (SunGraphics2D)backBuffer.getGraphics();
            g.constrain(-insets.left, -insets.top,
                        backBuffer.getWidth(null) + insets.left,
                        backBuffer.getHeight(null) + insets.top);
            return g;
        }
View Full Code Here

Examples of com.db4o.query.Query.constrain()

  }

  @SuppressWarnings("unchecked")
  private List<INews> getNewsFromLink(INews newsItem) {
    Query query = fDb.query();
    query.constrain(News.class);
    query.descend("fLinkText").constrain(newsItem.getLink().toString()); //$NON-NLS-1$
    return activateAll(query.execute());
  }

  @SuppressWarnings("unchecked")
View Full Code Here

Examples of com.db4o.query.Query.constrain()

  }

  @SuppressWarnings("unchecked")
  private List<INews> getNewsFromGuid(INews newsItem) {
    Query query = fDb.query();
    query.constrain(News.class);
    query.descend("fGuidValue").constrain(newsItem.getGuid().getValue()); //$NON-NLS-1$
    return activateAll(query.execute());
  }

  private void saveFeed(MergeResult mergeResult) {
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    INews newsCopy = fTypesFactory.createNews(news, newsBin);
    DynamicDAO.save(newsCopy);
    DynamicDAO.save(newsBin);

    Query query = fDb.query();
    query.constrain(News.class);
    query.descend("fParentId").constrain(0).not();
    List<?> newsCopies = query.execute();
    assertEquals(1, newsCopies.size());
    assertEquals(newsCopy, newsCopies.get(0));
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    List<?> newsCopies = query.execute();
    assertEquals(1, newsCopies.size());
    assertEquals(newsCopy, newsCopies.get(0));

    query = fDb.query();
    query.constrain(News.class);
    query.descend("fParentId").constrain(0);
    List<?> newsList = query.execute();
    assertEquals(1, newsList.size());
    assertEquals(news, newsList.get(0));
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    List<?> newsList = query.execute();
    assertEquals(1, newsList.size());
    assertEquals(news, newsList.get(0));

    query = fDb.query();
    query.constrain(News.class);
    query.descend("fGuidValue").constrain(news.getGuid().getValue());
    query.descend("fParentId").constrain(0).not();
    newsCopies = query.execute();
    assertEquals(1, newsCopies.size());
    assertEquals(newsCopy, newsCopies.get(0));
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    newsCopies = query.execute();
    assertEquals(1, newsCopies.size());
    assertEquals(newsCopy, newsCopies.get(0));

    query = fDb.query();
    query.constrain(News.class);
    query.descend("fGuidValue").constrain(news.getGuid().getValue());
    query.descend("fParentId").constrain(0);
    newsList = query.execute();
    assertEquals(1, newsList.size());
    assertEquals(news, newsList.get(0));
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    /* Assert Number of Entities */
    List<IEntity> entities = db.query(IEntity.class);
    assertEquals(entities.size(), defragmentedDb.query(IEntity.class).size());
    for (IEntity entity : entities) {
      Query query = defragmentedDb.query();
      query.constrain(entity.getClass());
      query.descend("fId").constrain(Long.valueOf(entity.getId())); //$NON-NLS-1$

      List<?> result = query.execute();
      assertEquals(1, result.size());
      assertEquals(entity, result.get(0));
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    /* Assert News */
    List<INews> newsList = db.query(INews.class);
    assertEquals(newsList.size(), defragmentedDb.query(INews.class).size());
    for (INews news : newsList) {
      Query query = defragmentedDb.query();
      query.constrain(news.getClass());
      query.descend("fId").constrain(Long.valueOf(news.getId())); //$NON-NLS-1$

      List<INews> result = query.execute();
      assertEquals(1, result.size());
      assertEquals(news.getTitle(), result.get(0).getTitle());
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    /* Assert Description */
    List<Description> descriptions = db.query(Description.class);
    assertEquals(descriptions.size(), defragmentedDb.query(Description.class).size());
    for (Description description : descriptions) {
      Query query = defragmentedDb.query();
      query.constrain(description.getClass());
      query.descend("fNewsId").constrain(Long.valueOf(description.getNews().getId())); //$NON-NLS-1$

      List<Description> result = query.execute();
      assertEquals(1, result.size());
      assertEquals(description.getValue(), result.get(0).getValue());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.